Skip to content

Commit

Permalink
fix: Stop returning UNKNOWN ERROR in the response if an actual erro…
Browse files Browse the repository at this point in the history
…r message is available (#4859)
  • Loading branch information
netroy authored Dec 8, 2022
1 parent 5156328 commit 4cb4c5e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/cli/src/ResponseHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,14 @@ export function sendErrorResponse(res: Response, error: Error) {

const response: ErrorResponse = {
code: 0,
message: 'Unknown error',
message: error.message ?? 'Unknown error',
};

if (error instanceof ResponseError) {
if (inDevelopment) {
console.error(picocolors.red(error.httpStatusCode), error.message);
}

response.message = error.message;
httpStatusCode = error.httpStatusCode;

if (error.errorCode) {
Expand Down

0 comments on commit 4cb4c5e

Please sign in to comment.