Skip to Main Content

Cloud Platform

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

get response body on error

user10261760Dec 1 2016 — edited Dec 2 2016

Hi all,

I made a rest service that return, if an error occurs, a message.

I would like to return to the client this error message but I cannot get the body of the response.
someone knows how it can be done ?

this is my custom api implementation:

req.oracleMobile.connectors.my_Conn.post(null,req.body, {inType: 'json', outType: 'json'})

                .then(

                        function (result) {                           

                            res.send(result.statusCode, result.result);

                        },

                        function (error) {                                                                                   

                           

                            res.contentType('application/json');

                            res.send(error.statusCode, error.error);

                        }

                );

Thanks.

Walter

This post has been answered by user10261760 on Dec 2 2016
Jump to Answer
Comments