I'm trying to learn more about REST and I was wondering about this situation:
REST Service INPUT
{
nrX: "1",
nrY: "2"
}
REST Service OUTPUT
{
sum: "3"
}
If something goes wrong in the REST Service internal implementation what should we return to the client who called the rest service ?
For my project i'm always returning this:
In case of failure:
{
exception: {
description: "description of the err",
code "500"
}
}
In case of success:
{
exception: {
description: "",
code "200"
}
response: "3"
}
is this correct ?