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);
|
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) {
|
for (const exception of exceptions) {
|
||||||
const errorPath = (exception.path ?? [])
|
const errorPath = (exception.path ?? [])
|
||||||
.map((v: string | number) => (typeof v === 'number' ? '$index' : v))
|
.map((v: string | number) => (typeof v === 'number' ? '$index' : v))
|
||||||
|
|||||||
@ -90,7 +90,7 @@ export const useExceptionHandler = <
|
|||||||
}>(
|
}>(
|
||||||
(acc, err) => {
|
(acc, err) => {
|
||||||
// Filter out exceptions that we don't want to be captured by exception handler
|
// 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);
|
acc.filtered.push(err);
|
||||||
} else {
|
} else {
|
||||||
acc.unfiltered.push(err);
|
acc.unfiltered.push(err);
|
||||||
|
|||||||
Reference in New Issue
Block a user