chore: error message is updated (#1037)

This commit is contained in:
palash-signoz 2022-05-03 21:21:10 +05:30 committed by GitHub
parent 284eda4072
commit 9f5241e82c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,10 +21,15 @@ export function ErrorResponseHandler(error: AxiosError): ErrorResponse {
};
}
const { errors, error } = data;
const errorMessage =
Array.isArray(errors) && errors.length >= 1 ? errors[0].msg : error;
return {
statusCode,
payload: null,
error: data.error,
error: errorMessage,
message: null,
};
}