Skip to content

Commit

Permalink
fix broken merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed Nov 29, 2023
1 parent 38eee72 commit 70a7a48
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/@uppy/companion-client/src/RequestClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ async function handleJSONResponse (res) {
try {
errData = await res.json()

errMsg = errData.message ? `${errMsg} message: ${errData.message}` : errMsg
errMsg = errData.requestId
? `${errMsg} request-Id: ${errData.requestId}`
: errMsg
if (errData.message) errMsg = `${errMsg} message: ${errData.message}`
if (errData.requestId) errMsg = `${errMsg} request-Id: ${errData.requestId}`
} catch (cause) {
// if the response contains invalid JSON, let's ignore the error data
throw new Error(errMsg, { cause })
Expand All @@ -59,8 +57,6 @@ async function handleJSONResponse (res) {
throw new UserFacingApiError(errData.message)
}

errMsg = errData.message ? `${errMsg} message: ${errData.message}` : errMsg
errMsg = errData.requestId ? `${errMsg} request-Id: ${errData.requestId}` : errMsg
throw new HttpError({ statusCode: res.status, message: errMsg })
}

Expand Down

0 comments on commit 70a7a48

Please sign in to comment.