HttpServerBoxed 0.0.11 alpha
A simple http server for C# and .NET
Loading...
Searching...
No Matches
HSB.Error Class Reference
Inheritance diagram for HSB.Error:
HSB.Servlet

Public Member Functions

 Error (Request req, Response res, Configuration config, string errorMessage, int errorCode)
 
override void ProcessGet ()
 
- Public Member Functions inherited from HSB.Servlet
 Servlet (Request req, Response res)
 
 Servlet (Request req, Response res, Configuration conf)
 
void AddCustomMethodHandler (string name, Delegate handler)
 
void RemoveCustomMethodHandler (string name)
 
string GetRoute ()
 
void Process ()
 
virtual void ProcessPost ()
 
virtual void ProcessDelete ()
 
virtual void ProcessPut ()
 
virtual void ProcessHead ()
 
virtual void ProcessPatch ()
 
virtual void ProcessOptions ()
 
virtual void ProcessTrace ()
 
virtual void ProcessConnect ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from HSB.Servlet
static string ReadFromResources (string resourceName)
 Extract a string from an embedded resource.
 
- Protected Attributes inherited from HSB.Servlet
Request req
 
Response res
 
Configuration configuration
 
Delegate? handlerFallback
 

Detailed Description

Definition at line 5 of file Error.cs.

Constructor & Destructor Documentation

◆ Error()

HSB.Error.Error ( Request  req,
Response  res,
Configuration  config,
string  errorMessage,
int  errorCode 
)

Definition at line 11 of file Error.cs.

11 : base(req, res, config)
12 {
13 this.errorCode = errorCode;
14 errorMsg = errorMessage;
15
16 handlerFallback = ProcessGet;
17 }

Member Function Documentation

◆ ProcessGet()

override void HSB.Error.ProcessGet ( )
virtual

Reimplemented from HSB.Servlet.

Definition at line 18 of file Error.cs.

19 {
20 var debugMode = false;
21#if DEBUG
22 debugMode = true;
23#endif
24
25 string title = $"Error {errorCode}";
26 string content = "";
27
28 if (errorCode >= 500 && errorCode <= 599)
29 {
30
31 if (debugMode || configuration.Debug.enabled)
32 content = GetStacktracePage();
33 else content = Get5XXPage();
34
35 errID = "stacktrace";
36 }
37
38 else if (errorCode >= 400 && errorCode <= 499)
39 content = Get4XXPage();
40
41
42
43 Send(title, content, errorCode);
44 }
Debugger Debug
Holds all debug information and routines.

The documentation for this class was generated from the following file: