Skip to content

Commit a9be249

Browse files
committed
fix(NextcloudBookmarks): Improve error reporting
Signed-off-by: Marcel Klehr <[email protected]>
1 parent aace83b commit a9be249

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/adapters/NextcloudBookmarks.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ export default class NextcloudBookmarksAdapter implements Adapter, BulkImportRes
851851
if (res.status === 401 || res.status === 403) {
852852
throw new AuthenticationError()
853853
}
854-
if (res.status === 503 || res.status > 400) {
854+
if (res.status === 503 || res.status >= 400) {
855855
throw new HttpError(res.status, verb)
856856
}
857857
let json
@@ -955,12 +955,12 @@ export default class NextcloudBookmarksAdapter implements Adapter, BulkImportRes
955955
if (res.status === 401 || res.status === 403) {
956956
throw new AuthenticationError()
957957
}
958-
if (res.status === 503 || res.status > 400) {
958+
if (res.status === 503 || res.status >= 400) {
959959
throw new HttpError(res.status, verb)
960960
}
961961
const json = res.data
962962
if (json.status !== 'success') {
963-
throw new Error('Nextcloud API error: \n' + JSON.stringify(json))
963+
throw new Error('Nextcloud API error for request ' + verb + ' ' + url + ' : \n' + JSON.stringify(json))
964964
}
965965

966966
return json

0 commit comments

Comments
 (0)