mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 08:34:07 -08:00
fix(editor): Add optional chaining to error handler (no-changelog) (#11500)
This commit is contained in:
parent
8b398256a8
commit
1f25e8e096
|
@ -113,8 +113,8 @@ export async function request(config: {
|
|||
});
|
||||
}
|
||||
|
||||
const errorResponseData = error.response.data;
|
||||
if (errorResponseData !== undefined && errorResponseData.message !== undefined) {
|
||||
const errorResponseData = error.response?.data;
|
||||
if (errorResponseData?.message !== undefined) {
|
||||
if (errorResponseData.name === 'NodeApiError') {
|
||||
errorResponseData.httpStatusCode = error.response.status;
|
||||
throw errorResponseData;
|
||||
|
|
Loading…
Reference in a new issue