File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change 1
1
Loopback
2
2
========
3
3
4
+ If you're using Loopback 2.x LTS, make sure
5
+ you've migrated to `strong-error-handler
6
+ <https://loopback.io/doc/en/lb2/Using-strong-error-handler.html> `_, otherwise no
7
+ errors will get to ``raven-node ``.
8
+
9
+ Configure ``raven-node `` as early as possible:
10
+
4
11
.. code-block :: javascript
5
12
6
- // server/middleware/sentry .js
13
+ // server/server .js
7
14
8
- var Raven = require (' raven' );
15
+ const Raven = require (' raven' );
9
16
Raven .config (' __DSN__' ).install ();
10
17
11
- module .exports = function () {
12
- return Raven .errorHandler ();
13
- }
18
+ Add ``Raven.errorHandler `` as a Loopback middleware:
14
19
15
- .. code-block :: javascript
20
+ .. code-block :: json
16
21
17
22
// server/middleware.json
18
23
19
- " final" : {
20
- " ./middleware/sentry" : {}
24
+ "final:after" : {
25
+ "raven#errorHandler" : {},
26
+ "strong-error-handler" : {
27
+ "debug" : false ,
28
+ "log" : false
29
+ }
21
30
}
31
+
32
+ You're all set!
You can’t perform that action at this time.
0 commit comments