report method

void report(
  1. Object error,
  2. StackTrace stackTrace
)

Log the error. Dox calls it for every error, except an IHttpException with a 4xx code (those are normal answers like 404 or 422). It is also called for errors outside a request, like a future that nobody awaited. The default prints the error and the stack with the logger, and the requestId when there is one.

Implementation

void report(Object error, StackTrace stackTrace) {
  String? id = _requestId;
  Logger.warn(id == null ? error : '[request $id] $error');
  Logger.danger(stackTrace.toString());
}