HttpException

Encapsulates an HTTP status as a D exception.

Constructors

this
this(HttpStatusCode status, string msg)
Undocumented in source.

Members

Variables

status
HttpStatusCode status;
Undocumented in source.

Examples

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);

Meta