Skip to content

Commit

Permalink
fix(NextcloudBookmarks): Improve error reporting
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr committed Nov 20, 2024
1 parent aace83b commit a9be249
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/adapters/NextcloudBookmarks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ export default class NextcloudBookmarksAdapter implements Adapter, BulkImportRes
if (res.status === 401 || res.status === 403) {
throw new AuthenticationError()
}
if (res.status === 503 || res.status > 400) {
if (res.status === 503 || res.status >= 400) {
throw new HttpError(res.status, verb)
}
let json
Expand Down Expand Up @@ -955,12 +955,12 @@ export default class NextcloudBookmarksAdapter implements Adapter, BulkImportRes
if (res.status === 401 || res.status === 403) {
throw new AuthenticationError()
}
if (res.status === 503 || res.status > 400) {
if (res.status === 503 || res.status >= 400) {
throw new HttpError(res.status, verb)
}
const json = res.data
if (json.status !== 'success') {
throw new Error('Nextcloud API error: \n' + JSON.stringify(json))
throw new Error('Nextcloud API error for request ' + verb + ' ' + url + ' : \n' + JSON.stringify(json))
}

return json
Expand Down

0 comments on commit a9be249

Please sign in to comment.