Skip to content

Commit

Permalink
Remove stac-fastapi workaround in error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Jul 27, 2023
1 parent 4b80f3d commit 67c7a89
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/views/Browse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,8 @@ export default {
errorDescription() {
if (this.error instanceof Error && this.error.isAxiosError && Utils.isObject(this.error.response)) {
let res = this.error.response;
if (Utils.isObject(res.data)) {
if (typeof res.data.description === 'string') { // STAC API compliant error response
return res.data.description;
}
else if (typeof res.data.detail === 'string') { // stac-fastapi returns an invalid "detail" property, see https://github.com/stac-utils/stac-fastapi/issues/360
return res.data.detail;
}
if (Utils.isObject(res.data) && typeof res.data.description === 'string') { // STAC API compliant error response
return res.data.description;
}
if (res.status === 401) {
return this.$t('errors.unauthorized');
Expand Down

0 comments on commit 67c7a89

Please sign in to comment.