Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed Dec 1, 2023
1 parent 0d81a9b commit 96eb565
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/@uppy/companion/src/server/provider/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ function errorToResponse (err) {
return { code: 401, json: { message: err.message } }
}

if (err instanceof ProviderUserError) {
return { code: 400, json: err.json }
}

if (err instanceof ProviderApiError) {
if (err.statusCode >= 500) {
// bad gateway i.e the provider APIs gateway
Expand All @@ -64,10 +68,6 @@ function errorToResponse (err) {
}
}

if (err instanceof ProviderUserError) {
return { code: 400, json: err.json }
}

return undefined
}

Expand Down

0 comments on commit 96eb565

Please sign in to comment.