Commits

jus...@basho.com  committed e31099f

document err/halt returns

  • Participants
  • Parent commits 3d3a237

Comments (0)

Files changed (1)

File WebmachineResources.wiki

 
 There are over 30 resource functions you can define, but any of them can be omitted as they have reasonable defaults.
 
-Each function is described below, showing the acceptable values that may be in the {{{Result}}} term. The default result is the one listed first, and will be used if a resource does not export the function.
+Each function is described below, showing the default and allowed values that may be in the {{{Result}}} term. The default will be used if a resource does not export the function.  If a function has an "X" in the "Halt" column, it also has the option of returning either of the two following special values for {{{ Result }}}.
+
+|=Result|=Effect|
+| {{{ {error, Err::term()} }}} | Immediately end processing of this request, returning a 500 response code.  The response body will contain the {{{ Err }}} term. |
+| {{{ {halt, Code::integer()} }}} | Immediately end processing of this request, returning response code Code.  It is the responsibility of the resource to ensure that all necessary response header and body elements are filled in {{{ ReqData }}} in order to make that reponse code valid. |
 
 Any function which has no description is optional and the effect of its return value should be evident from examining the [[BigHTTPGraph|diagram]].