Skip to content

Commit bda2363

Browse files
committed
Standardize console messages in @polar/plugin-address-search
Relates: #41
1 parent ea241a7 commit bda2363

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

packages/plugins/AddressSearch/src/store/actions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const makeActions = () => {
2828
.filter(({ url }) => !url)
2929
.forEach((miss) =>
3030
console.error(
31-
`POLAR Plugin AddressSearch: A specification is missing an URL: (${JSON.stringify(
31+
`@polar/plugin-address-search: A specification is missing an URL: (${JSON.stringify(
3232
miss
3333
)})`
3434
)
@@ -139,7 +139,7 @@ export const makeActions = () => {
139139
) as PromiseRejectedResult[]
140140
).forEach(({ reason }) =>
141141
console.error(
142-
'AddressSearch: An error occurred while sending a request: ',
142+
'@polar/plugin-address-search: An error occurred while sending a request: ',
143143
reason
144144
)
145145
)
@@ -149,7 +149,7 @@ export const makeActions = () => {
149149
})
150150
.catch((error: Error) => {
151151
console.error(
152-
'AddressSearch: An error occurred while searching.',
152+
'@polar/plugin-address-search: An error occurred while searching.',
153153
error
154154
)
155155
commit('setSearchResults', SearchResultSymbols.ERROR)

packages/plugins/AddressSearch/src/utils/searchMethods/getSearchMethod.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const getMethodContainer = () => {
1313
Object.entries(additionalMethods).forEach(([type, searchMethod]) => {
1414
if (methods[type]) {
1515
console.error(
16-
`AddressSearch: Method "${type}" already exists. Please choose a different name. Overrides are not allowed.`
16+
`@polar/plugin-address-search: Method "${type}" already exists. Please choose a different name. Overrides are not allowed.`
1717
)
1818
} else {
1919
methods[type] = searchMethod
@@ -26,7 +26,7 @@ export const getMethodContainer = () => {
2626
return method
2727
}
2828
throw new Error(
29-
`AddressSearch: The given type "${type}" does not define a valid searchMethod.`
29+
`The given type "${type}" does not define a valid searchMethod.`
3030
)
3131
}
3232

packages/plugins/AddressSearch/src/utils/searchMethods/mpapi.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ export default async function (
6868
// Case 2 example: "EPSG:25832"
6969
featureEPSG = srsName
7070
} else {
71-
console.error('Unknown formatting of projection:', srsName)
71+
console.error(
72+
'@polar/plugin-address-search: Unknown formatting of projection:',
73+
srsName
74+
)
7275
}
7376

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

7982
return featureCollection
8083
} catch (error) {
81-
console.error(error)
84+
console.error('@polar/plugin-address-search', error)
8285
throw new Error('An error occurred while fetching the feature collection.')
8386
}
8487
}

0 commit comments

Comments
 (0)