mirror of
https://github.com/opensim/opensim.git
synced 2026-07-13 19:14:51 +08:00
replace external httpserver by embedded one (based on same code) - This may still be very bad; clean solution and runprebuild, or clone to clan folder
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
|
||||
namespace OSHttpServer.Exceptions
|
||||
{
|
||||
/// <summary>
|
||||
/// All HTTP based exceptions will derive this class.
|
||||
/// </summary>
|
||||
public class HttpException : Exception
|
||||
{
|
||||
private readonly HttpStatusCode _code;
|
||||
|
||||
/// <summary>
|
||||
/// Create a new HttpException
|
||||
/// </summary>
|
||||
/// <param name="code">http status code (sent in the response)</param>
|
||||
/// <param name="message">error description</param>
|
||||
public HttpException(HttpStatusCode code, string message) : base(code + ": " + message)
|
||||
{
|
||||
_code = code;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a new HttpException
|
||||
/// </summary>
|
||||
/// <param name="code">http status code (sent in the response)</param>
|
||||
/// <param name="message">error description</param>
|
||||
/// <param name="inner">inner exception</param>
|
||||
public HttpException(HttpStatusCode code, string message, Exception inner)
|
||||
: base(code + ": " + message, inner)
|
||||
{
|
||||
_code = code;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// status code to use in the response.
|
||||
/// </summary>
|
||||
public HttpStatusCode HttpStatusCode
|
||||
{
|
||||
get { return _code; }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user