Skip to content

Commit

Permalink
Revert
Browse files Browse the repository at this point in the history
  • Loading branch information
dherault committed Aug 30, 2024
1 parent e571570 commit 63c6149
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/events/http/HttpServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ export default class HttpServer {
/* RESPONSE SELECTION (among endpoint's possible responses) */

// Failure handling
let errorStatusCode = "500"
let errorStatusCode = "502"

if (err) {
const errorMessage = (err.message || err).toString()
Expand All @@ -655,17 +655,14 @@ export default class HttpServer {
if (found && found.length > 1) {
;[, errorStatusCode] = found
} else {
errorStatusCode = "500"
errorStatusCode = "502"
}

// Mocks Lambda errors
result = {
body: JSON.stringify({
message: errorMessage,
stackTrace: this.#getArrayStackTrace(err.stack),
type: err.constructor.name,
}),
statusCode: errorStatusCode,
errorMessage,
errorType: err.constructor.name,
stackTrace: this.#getArrayStackTrace(err.stack),
}

log.error(errorMessage)
Expand Down

0 comments on commit 63c6149

Please sign in to comment.