Enable filtering out of expected 400 errors (#14371)
We decided to send 4xx errors to sentry from the FE, except for ForbiddenErrors. In some cases, we also need not to send to sentry some 4xx errors, like user input error, because the error stemming from the user input is unpredictable (ex: duplicate entry for a record with unicity constraints) and thus acceptable. Let's add a isExpected extension on UserInputErrors to introduce a specific behaviour for them (do not send to sentry).
This commit is contained in:
+1
@@ -54,6 +54,7 @@ export const handleDuplicateKeyError = (
|
||||
`Duplicate ${columnNames} ${duplicatedValues ? `with value ${duplicatedValues}` : ''}. Please set a unique one.`,
|
||||
{
|
||||
userFriendlyMessage: `This ${columnNames.toLowerCase()} ${duplicatedValues ? `with value ${duplicatedValues}` : ''} is already taken. Please choose a different value.`,
|
||||
isExpected: true,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user