Response.serverError constructor

Response.serverError(
  1. Request request,
  2. dynamic exception,
  3. dynamic stackTrace
)

Initialize a newly created instance to represent the SERVER_ERROR error condition.

Implementation

factory Response.serverError(Request request, exception, stackTrace) {
  var error =
      RequestError(RequestErrorCode.SERVER_ERROR, exception.toString());
  if (stackTrace != null) {
    error.stackTrace = stackTrace.toString();
  }
  return Response(request.id, error: error);
}