I have a MEAN-stack backend where I'd like to respond with
return res.status(400).jsonp({
message: 'Parsing failed.',
code: '123'
});
When an angular app uses this JSONP endpoint and encounters this particular error, it receives a 400 but without its payload. When I change the status to 200/300 it comes through fine, with 400/500 it doesn't.
On other routes (POST) I can respond with a 4** status code and payload without any issues.
return res.status(400).send({
message: 'Codes do not match.',
code: '234'
});
Any Idea what I'm overlooking?