pub async fn handle_error(
error: RouterError,
metrics: &StatsdClient,
db: &dyn DbClient,
platform: &str,
app_id: &str,
uaid: Uuid,
vapid: Option<VapidHeaderWithKey>,
) -> ApiError
Expand description
Handle a bridge error by logging, updating metrics, etc
This function uses the standard slog
recording mechanisms and
optionally calls a generic metric recording function for some
types of errors. The error is returned by this function for later
processing. This can include being called by the sentry middleware,
which uses the RecordableError
trait to optionally record metrics.
see [autopush_common::middleware::sentry::SentryWrapperMiddleware].call()
method