-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathignore-default.js
More file actions
30 lines (25 loc) · 801 Bytes
/
ignore-default.js
File metadata and controls
30 lines (25 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const Sentry = require('@sentry/node');
Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
// Use default mode: 'warn' - integration is active but should ignore AI_NoOutputGeneratedError
});
// Create an error with the name that should be ignored by default
class AI_NoOutputGeneratedError extends Error {
constructor(message) {
super(message);
this.name = 'AI_NoOutputGeneratedError';
}
}
class AbortError extends Error {
constructor(message) {
super(message);
this.name = 'AbortError';
}
}
setTimeout(() => {
process.stdout.write("I'm alive!");
process.exit(0);
}, 500);
// These should be ignored by default and not produce a warning
Promise.reject(new AI_NoOutputGeneratedError('Stream aborted'));
Promise.reject(new AbortError('Stream aborted'));