-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
Problem Statement
The problem is that I am throwing an error with custom properties, e.g.
export class UnexpectedStateError extends Error {
public cause?: unknown;
public extra?: Extras;
public constructor(
message: string,
options?: { cause?: unknown; extra?: Extras },
) {
super(message);
this.name = new.target.name;
this.extra = options?.extra;
this.cause = options?.cause;
}
}
throw new UnexpectedStateError('foo', {
extra: {
mcpServerId,
},
});
Now, the earliest that I am able to catch the error appears to be here:
Sentry.addEventProcessor(async (event) => {
console.log('[instrument] Sentry.addEventProcessor', event);
return event;
});
but at this point, I already cannot find my extra
property anymore.
Solution Brainstorm
- allow to customize the serializer for erros
- update the serializer to always capture the contents of
extra
property (aligns withcaptureException
)
Metadata
Metadata
Assignees
Type
Projects
Status
Waiting for: Product Owner