Skip to content

Commit 7c8dc2f

Browse files
authored
chore(sentry): filter errors from malformed requests (#387)
1 parent 68800e5 commit 7c8dc2f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/api/server.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,20 @@ const FILTERED_ERROR_TYPES = [
2525
const FILTERED_ERROR_CODES = [
2626
"FST_ERR_VALIDATION",
2727
"FST_ERR_CTP_INVALID_MEDIA_TYPE",
28+
"FST_ERR_CTP_EMPTY_JSON_BODY",
2829
];
2930
const FILTERED_STATUS_CODES = [422];
3031

3132
if (CONFIG.sentry.dsn) {
3233
Sentry.init({
3334
dsn: CONFIG.sentry.dsn,
35+
ignoreErrors: [
36+
"Object contains forbidden prototype property",
37+
"value too long for type character varying(255)",
38+
"Malformed urlencoded form",
39+
"Malformed part header",
40+
"Unexpected end of form",
41+
],
3442
beforeSend(event, hint) {
3543
// Filter all 422 status codes
3644
const originalError = hint.originalException;

0 commit comments

Comments
 (0)