DEBUG: create dedicated debug endpoints
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
35751bacf0
commit
c9084aea2c
18
api-server/server/boot/sentry-debug.js
Normal file
18
api-server/server/boot/sentry-debug.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { wrapHandledError } from '../utils/create-handled-error';
|
||||||
|
|
||||||
|
export default function bootStatus(app) {
|
||||||
|
const api = app.loopback.Router();
|
||||||
|
|
||||||
|
// DEBUG ROUTE
|
||||||
|
api.get('/sentry/error', () => {
|
||||||
|
throw Error('debugging sentry');
|
||||||
|
});
|
||||||
|
api.get('/sentry/wrapped', () => {
|
||||||
|
throw wrapHandledError(Error('debugging sentry, wrapped'), {
|
||||||
|
type: 'info',
|
||||||
|
message: 'debugmessage',
|
||||||
|
redirectTo: `a/page`
|
||||||
|
});
|
||||||
|
});
|
||||||
|
app.use(api);
|
||||||
|
}
|
Reference in New Issue
Block a user