import ae.net.http.responseex : HttpResponseEx; auto response = new HttpResponseEx; bool evilDetected = true; try { if (evilDetected) throw new HttpException(HttpStatusCode.Forbidden, "Do no evil!"); } catch (HttpException e) response.writeError(e.status, e.msg); catch (Exception e) response.writeError(HttpStatusCode.InternalServerError, e.msg);
Encapsulates an HTTP status as a D exception.