This is my update handler
function (doc, req) {
var resp;
if (doc == null) {
doc = {};
}
if (doc.email) {
resp = {
status: 403,
body: 'already signed up with ' + doc.email
};
return [doc, resp];
} else {
...
}
}
Instead of a response with an 403 error, I get a 500 with this content:
{"error":"external_response_error","reason":"Invalid data from external
server: {<<\"status\">>,403}"}
The logs don't tell more neither.
Is this a bug or is it simply not intended to work this way?
– Gregor
PS: Just figured out that it works like that:
throw(['error', 'forbidden','already signed up with ' + doc.email)
I'd still appreciate an explanation