mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-03-24 03:13:07 +00:00
fix: resolve 5 bugs in n8n_manage_datatable (#651)
This commit is contained in:
committed by
GitHub
parent
be3d07dbdc
commit
c5665632af
@@ -22,8 +22,10 @@ export class N8nAuthenticationError extends N8nApiError {
|
||||
}
|
||||
|
||||
export class N8nNotFoundError extends N8nApiError {
|
||||
constructor(resource: string, id?: string) {
|
||||
const message = id ? `${resource} with ID ${id} not found` : `${resource} not found`;
|
||||
constructor(messageOrResource: string, id?: string) {
|
||||
// If id is provided, format as "resource with ID id not found"
|
||||
// Otherwise, use messageOrResource as-is (it's already a complete message from the API)
|
||||
const message = id ? `${messageOrResource} with ID ${id} not found` : messageOrResource;
|
||||
super(message, 404, 'NOT_FOUND');
|
||||
this.name = 'N8nNotFoundError';
|
||||
}
|
||||
@@ -70,7 +72,7 @@ export function handleN8nApiError(error: unknown): N8nApiError {
|
||||
case 401:
|
||||
return new N8nAuthenticationError(message);
|
||||
case 404:
|
||||
return new N8nNotFoundError('Resource', message);
|
||||
return new N8nNotFoundError(message || 'Resource');
|
||||
case 400:
|
||||
return new N8nValidationError(message, data);
|
||||
case 429:
|
||||
|
||||
Reference in New Issue
Block a user