Skip to content

Commit db857f9

Browse files
robhanlon22kamilogorek
authored andcommitted
docs: Update loopback docs (#427)
1 parent 6ce861f commit db857f9

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

docs/integrations/loopback.rst

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
11
Loopback
22
========
33

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+
411
.. code-block:: javascript
512
6-
// server/middleware/sentry.js
13+
// server/server.js
714
8-
var Raven = require('raven');
15+
const Raven = require('raven');
916
Raven.config('__DSN__').install();
1017
11-
module.exports = function () {
12-
return Raven.errorHandler();
13-
}
18+
Add ``Raven.errorHandler`` as a Loopback middleware:
1419

15-
.. code-block:: javascript
20+
.. code-block:: json
1621
1722
// server/middleware.json
1823
19-
"final": {
20-
"./middleware/sentry": {}
24+
"final:after": {
25+
"raven#errorHandler": {},
26+
"strong-error-handler": {
27+
"debug": false,
28+
"log": false
29+
}
2130
}
31+
32+
You're all set!

0 commit comments

Comments
 (0)