Skip to content

Commit

Permalink
Standardize console messages in @polar/plugin-address-search
Browse files Browse the repository at this point in the history
Relates: #41
  • Loading branch information
dopenguin committed Jan 10, 2024
1 parent ea241a7 commit bda2363
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/plugins/AddressSearch/src/store/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const makeActions = () => {
.filter(({ url }) => !url)
.forEach((miss) =>
console.error(
`POLAR Plugin AddressSearch: A specification is missing an URL: (${JSON.stringify(
`@polar/plugin-address-search: A specification is missing an URL: (${JSON.stringify(
miss
)})`
)
Expand Down Expand Up @@ -139,7 +139,7 @@ export const makeActions = () => {
) as PromiseRejectedResult[]
).forEach(({ reason }) =>
console.error(
'AddressSearch: An error occurred while sending a request: ',
'@polar/plugin-address-search: An error occurred while sending a request: ',
reason
)
)
Expand All @@ -149,7 +149,7 @@ export const makeActions = () => {
})
.catch((error: Error) => {
console.error(
'AddressSearch: An error occurred while searching.',
'@polar/plugin-address-search: An error occurred while searching.',
error
)
commit('setSearchResults', SearchResultSymbols.ERROR)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const getMethodContainer = () => {
Object.entries(additionalMethods).forEach(([type, searchMethod]) => {
if (methods[type]) {
console.error(
`AddressSearch: Method "${type}" already exists. Please choose a different name. Overrides are not allowed.`
`@polar/plugin-address-search: Method "${type}" already exists. Please choose a different name. Overrides are not allowed.`
)
} else {
methods[type] = searchMethod
Expand All @@ -26,7 +26,7 @@ export const getMethodContainer = () => {
return method
}
throw new Error(
`AddressSearch: The given type "${type}" does not define a valid searchMethod.`
`The given type "${type}" does not define a valid searchMethod.`
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ export default async function (
// Case 2 example: "EPSG:25832"
featureEPSG = srsName
} else {
console.error('Unknown formatting of projection:', srsName)
console.error(
'@polar/plugin-address-search: Unknown formatting of projection:',
srsName
)
}

const featureCollection: FeatureCollection = {
Expand All @@ -78,7 +81,7 @@ export default async function (

return featureCollection
} catch (error) {
console.error(error)
console.error('@polar/plugin-address-search', error)
throw new Error('An error occurred while fetching the feature collection.')
}
}

0 comments on commit bda2363

Please sign in to comment.