Next: , Up: Server endpoints   [Contents][Index]


12.1 Error signalling

The (webid-oidc server endpoint) module defines exception types that can be emitted to abort the computation in a handler. If an exception of a different kind is raised, this will lead to a 500 Internal Server Error response.

Exception type: &web-exception code reason-phrase

The request failed, with code and reason-phrase.

function: make-web-exception code reason-phrase

Create an exception with code and reason-phrase.

function: web-exception? exn

Check if exn was thrown because the request failed.

function: web-exception-code exn
function: web-exception-reason-phrase exn

Return the code and reason-phrase for when exn was thrown, if it was thrown because of a failing request.

Exception type: &caused-by-user webid

If a web exception is raised, maybe it is caused by some user identified by webid (an URI, or #f.

function: make-caused-by-user webid

Constructor for &caused-by-user.

function: caused-by-user? exn

Check if exn was caused by the user.

function: caused-by-user-webid exn

Return the webid of the user that caused exn.

Exception type: &user-message sxml

An exception containing a message that is safe to show to the user, as an SXML fragment of XHTML. Typically, this would be a <p/>, or a <div/>.

You can set a user-message multiple times. The occurences will be concatenated in the response, in the order they appear in the composite exception.

function: make-user-message sxml

Create a new user message containing the sxml fragment.

function: user-message? exn

Check if there is at least one user message in exn.

function: user-message-sxml exn

Return all user messages in exn, as a <div/> SXML fragment.


Next: , Up: Server endpoints   [Contents][Index]