Once you set like above, jaggery will set the above status and the content(no need to use "response.sendError()") to the response.
On Fri, Nov 13, 2015 at 10:24 AM, Samith Dassanayake <[email protected]> wrote: > Hi Kamidu, > > You can set the status[1] and the content as below > > response.status = 400; // Set you HTTP status here > response.content = e; // Set your content > > [1] http://jaggeryjs.org/documentation.jag?api=jagconf > > Regards, > Samith > > > > > > On Fri, Nov 13, 2015 at 9:57 AM, Kamidu Punchihewa <[email protected]> > wrote: > >> >> Hi All, >> >> I have a requirement of sending a backend error as a responseText which >> holds an error message and response status which holds the error code. >> I have tried using response.sendError() but it sends the apache tomcat >> server page as the response. >> Any other way I can achieve this? >> >> The current way of sending error message and code as json object results >> in errors and bad requests also receive with status 200 with the error code >> in the responseText. >> >> Thanks and Regards. >> >> Kamidu Sachith Punchihewa >> *Software Engineer* >> WSO2, Inc. >> lean . enterprise . middleware >> Mobile : +94 (0) 770566749 <%2B94%20%280%29%20773%20451194> >> >> >> Disclaimer: This communication may contain privileged or other >> confidential information and is intended exclusively for the addressee/s. >> If you are not the intended recipient/s, or believe that you may have >> received this communication in error, please reply to the sender indicating >> that fact and delete the copy you received and in addition, you should not >> print, copy, retransmit, disseminate, or otherwise use the information >> contained in this communication. Internet communications cannot be >> guaranteed to be timely, secure, error or virus-free. The sender does not >> accept liability for any errors or omissions. >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > Best Regards > > Samith Dassanayake > Software Engineer | Cloud TG > WSO2, Inc. | http://wso2.com > lean. enterprise. middleware > > Mobile : +947 76207351 > Blog : buddycode.blogspot.com > -- Best Regards Samith Dassanayake Software Engineer | Cloud TG WSO2, Inc. | http://wso2.com lean. enterprise. middleware Mobile : +947 76207351 Blog : buddycode.blogspot.com
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
