mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
fix: Stop returning UNKNOWN ERROR
in the response if an actual error message is available (#4859)
This commit is contained in:
parent
5156328c34
commit
4cb4c5e818
|
@ -133,7 +133,7 @@ export function sendErrorResponse(res: Response, error: Error) {
|
|||
|
||||
const response: ErrorResponse = {
|
||||
code: 0,
|
||||
message: 'Unknown error',
|
||||
message: error.message ?? 'Unknown error',
|
||||
};
|
||||
|
||||
if (error instanceof ResponseError) {
|
||||
|
@ -141,7 +141,6 @@ export function sendErrorResponse(res: Response, error: Error) {
|
|||
console.error(picocolors.red(error.httpStatusCode), error.message);
|
||||
}
|
||||
|
||||
response.message = error.message;
|
||||
httpStatusCode = error.httpStatusCode;
|
||||
|
||||
if (error.errorCode) {
|
||||
|
|
Loading…
Reference in a new issue