module type ERROR =sig
..end
The type of error modules; input signature of Make
.
This is the type of error-handling module you must write and pass to Make
in order to
realize a main function to call to implement your service.
See Restful.Error
for a pre-defined ERROR
module that you might use
instead.
type
data
val loginit : string list -> data
val handler : data ->
Restful.Types.mode ->
(Netcgi.cgi -> Nethttp.http_status) -> Netcgi.cgi -> unit
Type of function that handles errors. Takes a mode, a
Restful.SERVICE.main
function, and a CGI activation object. Typically
will distinguish between Types.User_exn
and all other exceptions,
generating a 400 error for the former and a 500 error for the
latter, but this is up to you.
The Restful.Error
module provides a handy implementation of simple
text/plain errors.