mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
⚡ Make Github webhook create error message clearer
This commit is contained in:
@@ -352,7 +352,17 @@ export class GithubTrigger implements INodeType {
|
||||
active: true,
|
||||
};
|
||||
|
||||
const responseData = await githubApiRequest.call(this, 'POST', endpoint, body);
|
||||
|
||||
let responseData;
|
||||
try {
|
||||
responseData = await githubApiRequest.call(this, 'POST', endpoint, body);
|
||||
} catch (e) {
|
||||
if (e.message.includes('[422]:')) {
|
||||
throw new Error('A webhook with the identical URL exists already. Please delete it manually on Github!');
|
||||
}
|
||||
|
||||
throw e;
|
||||
}
|
||||
|
||||
if (responseData.id === undefined || responseData.active !== true) {
|
||||
// Required data is missing so was not successful
|
||||
|
||||
Reference in New Issue
Block a user