@devmoods/sentry 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/coverage/base.css +262 -124
- package/coverage/block-navigation.js +64 -69
- package/coverage/clover.xml +3 -3
- package/coverage/coverage-final.json +1 -1
- package/coverage/index.html +1 -1
- package/coverage/index.ts.html +84 -15
- package/coverage/prettify.css +101 -1
- package/coverage/prettify.js +936 -1
- package/coverage/sorter.js +187 -192
- package/dist/index.d.ts +0 -2
- package/dist/index.js +20 -10
- package/package.json +6 -6
- package/src/__tests__/index.spec.ts +60 -2
- package/src/index.ts +35 -12
package/coverage/index.ts.html
CHANGED
|
@@ -241,7 +241,54 @@
|
|
|
241
241
|
<a name='L176'></a><a href='#L176'>176</a>
|
|
242
242
|
<a name='L177'></a><a href='#L177'>177</a>
|
|
243
243
|
<a name='L178'></a><a href='#L178'>178</a>
|
|
244
|
-
<a name='L179'></a><a href='#L179'>179</a
|
|
244
|
+
<a name='L179'></a><a href='#L179'>179</a>
|
|
245
|
+
<a name='L180'></a><a href='#L180'>180</a>
|
|
246
|
+
<a name='L181'></a><a href='#L181'>181</a>
|
|
247
|
+
<a name='L182'></a><a href='#L182'>182</a>
|
|
248
|
+
<a name='L183'></a><a href='#L183'>183</a>
|
|
249
|
+
<a name='L184'></a><a href='#L184'>184</a>
|
|
250
|
+
<a name='L185'></a><a href='#L185'>185</a>
|
|
251
|
+
<a name='L186'></a><a href='#L186'>186</a>
|
|
252
|
+
<a name='L187'></a><a href='#L187'>187</a>
|
|
253
|
+
<a name='L188'></a><a href='#L188'>188</a>
|
|
254
|
+
<a name='L189'></a><a href='#L189'>189</a>
|
|
255
|
+
<a name='L190'></a><a href='#L190'>190</a>
|
|
256
|
+
<a name='L191'></a><a href='#L191'>191</a>
|
|
257
|
+
<a name='L192'></a><a href='#L192'>192</a>
|
|
258
|
+
<a name='L193'></a><a href='#L193'>193</a>
|
|
259
|
+
<a name='L194'></a><a href='#L194'>194</a>
|
|
260
|
+
<a name='L195'></a><a href='#L195'>195</a>
|
|
261
|
+
<a name='L196'></a><a href='#L196'>196</a>
|
|
262
|
+
<a name='L197'></a><a href='#L197'>197</a>
|
|
263
|
+
<a name='L198'></a><a href='#L198'>198</a>
|
|
264
|
+
<a name='L199'></a><a href='#L199'>199</a>
|
|
265
|
+
<a name='L200'></a><a href='#L200'>200</a>
|
|
266
|
+
<a name='L201'></a><a href='#L201'>201</a>
|
|
267
|
+
<a name='L202'></a><a href='#L202'>202</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
268
|
+
<span class="cline-any cline-neutral"> </span>
|
|
269
|
+
<span class="cline-any cline-neutral"> </span>
|
|
270
|
+
<span class="cline-any cline-neutral"> </span>
|
|
271
|
+
<span class="cline-any cline-neutral"> </span>
|
|
272
|
+
<span class="cline-any cline-neutral"> </span>
|
|
273
|
+
<span class="cline-any cline-neutral"> </span>
|
|
274
|
+
<span class="cline-any cline-neutral"> </span>
|
|
275
|
+
<span class="cline-any cline-neutral"> </span>
|
|
276
|
+
<span class="cline-any cline-neutral"> </span>
|
|
277
|
+
<span class="cline-any cline-neutral"> </span>
|
|
278
|
+
<span class="cline-any cline-neutral"> </span>
|
|
279
|
+
<span class="cline-any cline-yes">13x</span>
|
|
280
|
+
<span class="cline-any cline-neutral"> </span>
|
|
281
|
+
<span class="cline-any cline-neutral"> </span>
|
|
282
|
+
<span class="cline-any cline-neutral"> </span>
|
|
283
|
+
<span class="cline-any cline-neutral"> </span>
|
|
284
|
+
<span class="cline-any cline-neutral"> </span>
|
|
285
|
+
<span class="cline-any cline-neutral"> </span>
|
|
286
|
+
<span class="cline-any cline-neutral"> </span>
|
|
287
|
+
<span class="cline-any cline-neutral"> </span>
|
|
288
|
+
<span class="cline-any cline-neutral"> </span>
|
|
289
|
+
<span class="cline-any cline-neutral"> </span>
|
|
290
|
+
<span class="cline-any cline-neutral"> </span>
|
|
291
|
+
<span class="cline-any cline-neutral"> </span>
|
|
245
292
|
<span class="cline-any cline-neutral"> </span>
|
|
246
293
|
<span class="cline-any cline-neutral"> </span>
|
|
247
294
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -254,7 +301,6 @@
|
|
|
254
301
|
<span class="cline-any cline-neutral"> </span>
|
|
255
302
|
<span class="cline-any cline-neutral"> </span>
|
|
256
303
|
<span class="cline-any cline-neutral"> </span>
|
|
257
|
-
<span class="cline-any cline-yes">10x</span>
|
|
258
304
|
<span class="cline-any cline-neutral"> </span>
|
|
259
305
|
<span class="cline-any cline-neutral"> </span>
|
|
260
306
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -426,7 +472,6 @@ import {
|
|
|
426
472
|
type MetricsAdapter,
|
|
427
473
|
} from '@devmoods/observability';
|
|
428
474
|
import * as Sentry from '@sentry/node';
|
|
429
|
-
import { type ErrorRequestHandler } from 'express';
|
|
430
475
|
|
|
431
476
|
declare module '@devmoods/config' {
|
|
432
477
|
interface Config extends ConfigFromDefs<typeof sentryConfig> {}
|
|
@@ -492,21 +537,45 @@ export async function sentryOptions(
|
|
|
492
537
|
dsn: config.SENTRY_DSN,
|
|
493
538
|
tracesSampleRate: config.SENTRY_TRACES_SAMPLE_RATE,
|
|
494
539
|
profileSessionSampleRate: config.SENTRY_PROFILES_SAMPLE_RATE,
|
|
495
|
-
integrations:
|
|
496
|
-
|
|
540
|
+
integrations: [
|
|
541
|
+
...nativeIntegrations,
|
|
542
|
+
Sentry.expressIntegration({
|
|
543
|
+
shouldHandleError(error) {
|
|
544
|
+
const status = getHttpStatusCode(error);
|
|
545
|
+
|
|
546
|
+
return (
|
|
547
|
+
process.env.NODE_ENV === 'production' &&
|
|
548
|
+
(status == null || status < 400 || status >= 500)
|
|
549
|
+
);
|
|
550
|
+
},
|
|
551
|
+
}),
|
|
552
|
+
],
|
|
497
553
|
...options,
|
|
498
554
|
};
|
|
499
555
|
}
|
|
500
556
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
557
|
+
function getHttpStatusCode(error: unknown) {
|
|
558
|
+
if (error == null || typeof error !== 'object') {
|
|
559
|
+
return undefined;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
const {
|
|
563
|
+
status,
|
|
564
|
+
statusCode,
|
|
565
|
+
status_code: statusCodeSnake,
|
|
566
|
+
output,
|
|
567
|
+
} = error as {
|
|
568
|
+
status?: number | string;
|
|
569
|
+
statusCode?: number | string;
|
|
570
|
+
status_code?: number | string;
|
|
571
|
+
output?: { statusCode?: number | string };
|
|
572
|
+
};
|
|
573
|
+
const value = status ?? statusCode ?? statusCodeSnake ?? output?.statusCode;
|
|
574
|
+
const parsed = typeof value === 'string' ? Number.parseInt(value, 10) : value;
|
|
575
|
+
|
|
576
|
+
return typeof parsed === 'number' && Number.isFinite(parsed)
|
|
577
|
+
? parsed
|
|
578
|
+
: undefined;
|
|
510
579
|
}
|
|
511
580
|
|
|
512
581
|
/**
|
|
@@ -604,7 +673,7 @@ export class SentryLoggerAdapter implements LoggerAdapter {
|
|
|
604
673
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
605
674
|
Code coverage generated by
|
|
606
675
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
607
|
-
at 2026-
|
|
676
|
+
at 2026-10-05T20:21:41.674Z
|
|
608
677
|
</div>
|
|
609
678
|
<script src="prettify.js"></script>
|
|
610
679
|
<script>
|
package/coverage/prettify.css
CHANGED
|
@@ -1 +1,101 @@
|
|
|
1
|
-
.pln
|
|
1
|
+
.pln {
|
|
2
|
+
color: #000;
|
|
3
|
+
}
|
|
4
|
+
@media screen {
|
|
5
|
+
.str {
|
|
6
|
+
color: #080;
|
|
7
|
+
}
|
|
8
|
+
.kwd {
|
|
9
|
+
color: #008;
|
|
10
|
+
}
|
|
11
|
+
.com {
|
|
12
|
+
color: #800;
|
|
13
|
+
}
|
|
14
|
+
.typ {
|
|
15
|
+
color: #606;
|
|
16
|
+
}
|
|
17
|
+
.lit {
|
|
18
|
+
color: #066;
|
|
19
|
+
}
|
|
20
|
+
.pun,
|
|
21
|
+
.opn,
|
|
22
|
+
.clo {
|
|
23
|
+
color: #660;
|
|
24
|
+
}
|
|
25
|
+
.tag {
|
|
26
|
+
color: #008;
|
|
27
|
+
}
|
|
28
|
+
.atn {
|
|
29
|
+
color: #606;
|
|
30
|
+
}
|
|
31
|
+
.atv {
|
|
32
|
+
color: #080;
|
|
33
|
+
}
|
|
34
|
+
.dec,
|
|
35
|
+
.var {
|
|
36
|
+
color: #606;
|
|
37
|
+
}
|
|
38
|
+
.fun {
|
|
39
|
+
color: red;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
@media print, projection {
|
|
43
|
+
.str {
|
|
44
|
+
color: #060;
|
|
45
|
+
}
|
|
46
|
+
.kwd {
|
|
47
|
+
color: #006;
|
|
48
|
+
font-weight: bold;
|
|
49
|
+
}
|
|
50
|
+
.com {
|
|
51
|
+
color: #600;
|
|
52
|
+
font-style: italic;
|
|
53
|
+
}
|
|
54
|
+
.typ {
|
|
55
|
+
color: #404;
|
|
56
|
+
font-weight: bold;
|
|
57
|
+
}
|
|
58
|
+
.lit {
|
|
59
|
+
color: #044;
|
|
60
|
+
}
|
|
61
|
+
.pun,
|
|
62
|
+
.opn,
|
|
63
|
+
.clo {
|
|
64
|
+
color: #440;
|
|
65
|
+
}
|
|
66
|
+
.tag {
|
|
67
|
+
color: #006;
|
|
68
|
+
font-weight: bold;
|
|
69
|
+
}
|
|
70
|
+
.atn {
|
|
71
|
+
color: #404;
|
|
72
|
+
}
|
|
73
|
+
.atv {
|
|
74
|
+
color: #060;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
pre.prettyprint {
|
|
78
|
+
padding: 2px;
|
|
79
|
+
border: 1px solid #888;
|
|
80
|
+
}
|
|
81
|
+
ol.linenums {
|
|
82
|
+
margin-top: 0;
|
|
83
|
+
margin-bottom: 0;
|
|
84
|
+
}
|
|
85
|
+
li.L0,
|
|
86
|
+
li.L1,
|
|
87
|
+
li.L2,
|
|
88
|
+
li.L3,
|
|
89
|
+
li.L5,
|
|
90
|
+
li.L6,
|
|
91
|
+
li.L7,
|
|
92
|
+
li.L8 {
|
|
93
|
+
list-style-type: none;
|
|
94
|
+
}
|
|
95
|
+
li.L1,
|
|
96
|
+
li.L3,
|
|
97
|
+
li.L5,
|
|
98
|
+
li.L7,
|
|
99
|
+
li.L9 {
|
|
100
|
+
background: #eee;
|
|
101
|
+
}
|