mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(core): Deduplicate error handling in nodes (#4319)
* Fix issue with isAxios property * 🥅 Deduplicate errors handeling improve errors for credentials * 🎨 correctly throws error
This commit is contained in:
@@ -27,12 +27,5 @@ export async function apiRequest(
|
||||
json: true,
|
||||
};
|
||||
|
||||
try {
|
||||
return await this.helpers.requestWithAuthentication.call(this, 'wekanApi', options);
|
||||
} catch (error) {
|
||||
if (error.statusCode === 401) {
|
||||
throw new NodeOperationError(this.getNode(), 'The Wekan credentials are not valid!');
|
||||
}
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject);
|
||||
}
|
||||
return await this.helpers.requestWithAuthentication.call(this, 'wekanApi', options);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user