fix: exception handler (#3768)
* fix: user is not sent to sentry * fix: too much exceptions thrown
This commit is contained in:
@ -49,6 +49,15 @@ export class ExceptionHandlerSentryDriver
|
||||
scope.setExtra('document', options.document);
|
||||
}
|
||||
|
||||
if (options?.user) {
|
||||
scope.setUser({
|
||||
id: options.user.id,
|
||||
ip_address: options.user.ipAddress,
|
||||
email: options.user.email,
|
||||
username: options.user.username,
|
||||
});
|
||||
}
|
||||
|
||||
for (const exception of exceptions) {
|
||||
const errorPath = (exception.path ?? [])
|
||||
.map((v: string | number) => (typeof v === 'number' ? '$index' : v))
|
||||
|
||||
@ -90,7 +90,7 @@ export const useExceptionHandler = <
|
||||
}>(
|
||||
(acc, err) => {
|
||||
// Filter out exceptions that we don't want to be captured by exception handler
|
||||
if (filterException(err)) {
|
||||
if (filterException(err?.originalError ?? err)) {
|
||||
acc.filtered.push(err);
|
||||
} else {
|
||||
acc.unfiltered.push(err);
|
||||
|
||||
Reference in New Issue
Block a user