function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
hiteshwar marnihiteshwar marni 

custom status message

In rest api i'm setting status code as 400.but it is always throwing error as bad request which is standard error message.but I need to send error message as no page.
Is it possible to override the error messages of standard http codes.
Ashish KumarAshish Kumar

Hi Hiteshwar,

Since you are getting status code 400 that means the request is either incorrect or corrupted and the server couldn't understand it.

Request could not made it to requested http method and hence it will not send anything you are setting in the method.
To override the things first request should made it to the request method only then you will be able to override the things but here in this case server is throwing standard message because it is not able to find what you requested.
Hope it clears the problem. Let me know if you need any help.

Ashish Kr.