Skip to content

Commit

Permalink
fix(controllers): send ping errors to Sentry (#1007)
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasduteil authored Feb 27, 2025
1 parent 601fc78 commit f1685fc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/controllers/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import {
InvalidSiretError,
NotFoundError,
} from "@gouvfr-lasuite/proconnect.identite/errors";
import * as Sentry from "@sentry/node";
import type { NextFunction, Request, Response } from "express";
import HttpErrors from "http-errors";
import { inspect } from "node:util";
import { z, ZodError } from "zod";
import notificationMessages from "../config/notification-messages";
import { getOrganizationInfo } from "../connectors/api-sirene";
Expand All @@ -32,7 +34,8 @@ export const getPingApiSireneController = async (

return res.json({});
} catch (e) {
logger.error(e);
logger.error(inspect(e, { depth: null }));
Sentry.captureException(e);
return res.status(502).json({ message: "Bad Gateway" });
}
};
Expand Down

0 comments on commit f1685fc

Please sign in to comment.