Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cacheMiddleware, NotFound } from './utils.js';
import { cacheMiddleware, NotFound, HttpError } from './utils.js';
import CONFIG from './config.loader.js';
global.CONFIG = CONFIG;

Expand Down Expand Up @@ -57,12 +57,12 @@ if (CONFIG.tests) {
app.use(logErrors);
app.use(errorHandler);


function logErrors(err, req, res, next) {
// Optional Sentry (instrument.js sets the global only when the
// linked module is present AND config has SENTRY_DSN — plain
// open-source installs never see it).
if (global.__Sentry) {
// Optional sentry when Iframely is used as a libary,
// initialized from outside of this package
if (global.__Sentry
&& !(err instanceof NotFound)
&& !(err instanceof HttpError && err.code < 500)) {
global.__Sentry.captureException(err);
}

Expand Down
Loading
Loading