withError method

void withError(
  1. Object e
)

Creates a http response with an error for the body and 500 (internal server error) as the status.

Implementation

void withError(Object e) {
  status = 500;
  body = e.toString();
  headers = {};
}