Layer7 API Management

 View Only
  • 1.  Customized error responses

    Posted Nov 10, 2016 10:56 PM

    Hi All,


    Is it possible to achieve a global policy which can throw different customized error responses based on the type of error thrown?


    For eg : for http 500 -> Error message 1

                       http 404 -> Error message 2

                        SQL attacks -> Different error

                         Invalid API key -> Different error


    I understand that types of possibles errors will be numerous and would be difficult to categorize each of them. But my idea is to have some custom error responses for certain set of known errors and I can have a generic error for all the other unhandled errors.


    Has anyone done similar to this? Really appreciate your suggestions.



  • 2.  Re: Customized error responses
    Best Answer

    Posted Nov 11, 2016 03:34 AM

    Hi Geethu,


    Please use the Customize Error Response Assertion. This assertion helps you to customize the error that you are sending back. You can choose a Http response status as well. Although this is not a global setting, it can be used where ever you need to send a customized error response.




    Seenu Mathew

  • 3.  Re: Customized error responses

    Posted Nov 14, 2016 04:15 AM

    Hi Geethu,

    Please mark the above answer as correct if it has helped you to answer your question. 


    Seenu mathew