equal
deleted
inserted
replaced
140 module:log("debug", "Sending[rest]: %s", result.stanza:top_tag()); |
140 module:log("debug", "Sending[rest]: %s", result.stanza:top_tag()); |
141 response.headers.content_type = send_type; |
141 response.headers.content_type = send_type; |
142 return encode(send_type, result.stanza); |
142 return encode(send_type, result.stanza); |
143 end, |
143 end, |
144 function (error) |
144 function (error) |
145 if error.context and error.context.stanza then |
145 if not errors.is_err(error) then |
|
146 module:log("error", "Uncaught native error: %s", error); |
|
147 return select(2, errors.coerce(nil, error)); |
|
148 elseif error.context and error.context.stanza then |
146 response.headers.content_type = send_type; |
149 response.headers.content_type = send_type; |
147 module:log("debug", "Sending[rest]: %s", error.context.stanza:top_tag()); |
150 module:log("debug", "Sending[rest]: %s", error.context.stanza:top_tag()); |
148 return encode(send_type, error.context.stanza); |
151 return encode(send_type, error.context.stanza); |
149 else |
152 else |
150 return error; |
153 return error; |