|
Daraja HTTP Framework 3.5.0-SNAPSHOT
HTTP server framework for Object Pascal
|
Functions | |
| ResetResponse (TdjResponse Response) | |
| Resets a response that a Web Component or Web Filter may already have partly filled in, so that an error response can be built on a clean state. | |
| SetErrorResponse (TdjResponse Response, Exception E, const string ComponentName='') | |
| Replaces whatever a failed Web Component, Web Filter or handler left on the response with the framework's 500 error page. | |
| ResetResponse | ( | TdjResponse | Response | ) |
Resets a response that a Web Component or Web Filter may already have partly filled in, so that an error response can be built on a clean state.
Clears the content (ContentText and ContentStream), every entity and response header field (ContentType, ContentLength, Location, ...) and CustomHeaders. Keeps the server name, the connection's keep-alive setting, and the cookies, because Indy stores a newly created session's cookie there.
| Response | the response to reset. Its headers must not have been sent yet. |
| SetErrorResponse | ( | TdjResponse | Response, |
| Exception | E, | ||
| const string | ComponentName = '' ) |
Replaces whatever a failed Web Component, Web Filter or handler left on the response with the framework's 500 error page.
The page is generic and discloses nothing about the exception, unless DARAJA_PROJECT_STAGE_DEVELOPMENT is defined: then it shows the exception class and message, the component name, and a stack trace where available.
If the response headers were already sent (for example by a component that streams its output), the status can no longer change. The pending content is dropped and the connection is closed instead, so the client sees a truncated response rather than an error page appended to a partial body.
| Response | the response to replace |
| E | the exception that caused the error |
| ComponentName | the Web Component that was handling the request, if known; shown only on the development page |