diff --git a/utils/monitoring.js b/utils/monitoring.js index c7ec7be6..ce934e27 100644 --- a/utils/monitoring.js +++ b/utils/monitoring.js @@ -59,7 +59,7 @@ const metricsCount = (promClient.register.getSingleMetric('count_items_metricsCo function _writeResponse(res, error) { let statusCode = 200; if (error) { - if (Number.isInteger(error.code)) { + if (error instanceof errors.ArsenalError && Number.isInteger(error.code)) { statusCode = error.code; } else { statusCode = 500;