Skip to content

Commit

Permalink
updates based on requested changed
Browse files Browse the repository at this point in the history
  • Loading branch information
harshasrikara committed Nov 3, 2020
1 parent babf6f2 commit 7592805
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions functions/src/express_configs/express_open.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,8 @@ app.use(bodyParser.urlencoded({ extended: true }));
// The error handler must be before any other error middleware and after all controllers
app.use(
Sentry.Handlers.errorHandler({
shouldHandleError(error) {
// Capture all errors over 400
if ((error.status as number) >= 400) {
return true;
}
return false;
},
// report the error to sentry if >=400
shouldHandleError: (error) => (error.status as number) >= 400,
})
);

Expand Down
2 changes: 1 addition & 1 deletion functions/src/express_configs/express_secure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function errorHandler(error: Error, request: Request, response: Response, next:
app.use(errorHandler);

// Automatically send uncaught exception errors to Sentry
process.on("uncaughtException", (error) => Sentry.captureException(error));
process.on("uncaughtException", (err) => Sentry.captureException(err));

const checkJwt = jwt({
secret: jwksRsa.expressJwtSecret({
Expand Down
2 changes: 1 addition & 1 deletion functions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import * as eventFunctions from "./events/events";
import * as vanityFunctions from "./custom/vanity";
import * as hacktoberfestFunctions from "./custom/hacktoberfest";
import * as typeformFunctions from "./application/typeform";
import * as errorFunctions from "./services/ErrorService";
import * as errorFunctions from "./services/errorService";

//this will match every call made to this api.
app_secure.all("/", (request, response, next) => {
Expand Down

0 comments on commit 7592805

Please sign in to comment.