mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08:00
fix(core): Improve handling of wrapped errors (no-changelog) (#8631)
This commit is contained in:
parent
100d9bc087
commit
2b9391a975
|
@ -45,8 +45,7 @@ export abstract class NodeError extends ExecutionBaseError {
|
|||
super(message, options);
|
||||
|
||||
if (error instanceof NodeError) {
|
||||
this.level = 'error';
|
||||
this.message = `[RE-WRAPPED]: ${message}`;
|
||||
this.tags.reWrapped = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ export type ReportingOptions = {
|
|||
export class ApplicationError extends Error {
|
||||
level: Level;
|
||||
|
||||
readonly tags?: Event['tags'];
|
||||
readonly tags: NonNullable<Event['tags']>;
|
||||
|
||||
readonly extra?: Event['extra'];
|
||||
|
||||
|
|
|
@ -13,10 +13,10 @@ describe('NodeError', () => {
|
|||
const wrapped2 = new NodeOperationError(node, opsError);
|
||||
|
||||
expect(wrapped1.level).toEqual('error');
|
||||
expect(wrapped1.message).toEqual(
|
||||
'[RE-WRAPPED]: The service was not able to process your request',
|
||||
);
|
||||
expect(wrapped1.message).toEqual('The service was not able to process your request');
|
||||
expect(wrapped1.tags).toEqual(expect.objectContaining({ reWrapped: true }));
|
||||
expect(wrapped2.level).toEqual('error');
|
||||
expect(wrapped2.message).toEqual('[RE-WRAPPED]: Some operation failed');
|
||||
expect(wrapped2.message).toEqual('Some operation failed');
|
||||
expect(wrapped2.tags).toEqual(expect.objectContaining({ reWrapped: true }));
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue