Topic
  • 5 replies
  • Latest Post - ‏2013-07-26T16:26:59Z by bruneves
bruneves
bruneves
42 Posts

Pinned topic Is it possible to change the default "Internal Error" message?

‏2013-07-25T21:02:13Z |

Hey DataPower buddies,

The requirement is simple, is it possible to change the default "Internal Error" message? If so, would that be possible to add more details explaining the reason for the "Internal Error" message? For example, if the client tries to access the wrong URI, can we show the message saying that there was no match for that URI?

Thank you!

Bruno

Updated on 2013-07-31T13:59:56Z at 2013-07-31T13:59:56Z by bruneves
  • HermannSW
    HermannSW
    4866 Posts
    ACCEPTED ANSWER

    Re: Is it possible to change the default "Internal Error" message?

    ‏2013-07-26T12:00:24Z  
    • bruneves
    • ‏2013-07-25T22:35:25Z

    Right, that we are doing already, but our client is more interested on changing the default "Internal Error" message, even before the request reaches a processing rule, like when you try to access a nonexistent URI for example...

    > but our client is more interested on changing the default "Internal Error" message,
    > even before the request reaches a processing rule, like when you try to access a nonexistent URI for example...
    >

    "nonexistent URI" means that your policy does not have "catch all" rules (otherwise there would be no nonexistent).

    In that case, you may add a catch all rule (eg. URL=*) as the very last Client2Server rule and return whatever you want by

    • <dp:reject>
    • and/or <xsl:message terminate="yes">

    In this case the response would not be generated by an error rule, but as described, rule processing cannot be avoided.

     

    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

  • swlinn
    swlinn
    1348 Posts

    Re: Is it possible to change the default "Internal Error" message?

    ‏2013-07-25T21:09:02Z  

    Hi Bruno,

    Sure, you can create your own error rule that produces a customized error response (soap fault, xml, non-xml) to match the schema of your consumer.  You would create a xsl that would create this output, and the transformation action would simply use the OUTPUT context as its output.

    Regards,

    Steve

  • bruneves
    bruneves
    42 Posts

    Re: Is it possible to change the default "Internal Error" message?

    ‏2013-07-25T22:35:25Z  
    • swlinn
    • ‏2013-07-25T21:09:02Z

    Hi Bruno,

    Sure, you can create your own error rule that produces a customized error response (soap fault, xml, non-xml) to match the schema of your consumer.  You would create a xsl that would create this output, and the transformation action would simply use the OUTPUT context as its output.

    Regards,

    Steve

    Right, that we are doing already, but our client is more interested on changing the default "Internal Error" message, even before the request reaches a processing rule, like when you try to access a nonexistent URI for example...

  • PradeepMalineni
    PradeepMalineni
    31 Posts

    Re: Is it possible to change the default "Internal Error" message?

    ‏2013-07-26T02:10:07Z  
    • bruneves
    • ‏2013-07-25T22:35:25Z

    Right, that we are doing already, but our client is more interested on changing the default "Internal Error" message, even before the request reaches a processing rule, like when you try to access a nonexistent URI for example...

    I believe that we need create a new proxy service (XML, MPGW etc..) before it reaches to your actual service and where in the first service you can create policy which modifies the Internal error message.

     

  • HermannSW
    HermannSW
    4866 Posts

    Re: Is it possible to change the default "Internal Error" message?

    ‏2013-07-26T12:00:24Z  
    • bruneves
    • ‏2013-07-25T22:35:25Z

    Right, that we are doing already, but our client is more interested on changing the default "Internal Error" message, even before the request reaches a processing rule, like when you try to access a nonexistent URI for example...

    > but our client is more interested on changing the default "Internal Error" message,
    > even before the request reaches a processing rule, like when you try to access a nonexistent URI for example...
    >

    "nonexistent URI" means that your policy does not have "catch all" rules (otherwise there would be no nonexistent).

    In that case, you may add a catch all rule (eg. URL=*) as the very last Client2Server rule and return whatever you want by

    • <dp:reject>
    • and/or <xsl:message terminate="yes">

    In this case the response would not be generated by an error rule, but as described, rule processing cannot be avoided.

     

    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

  • bruneves
    bruneves
    42 Posts

    Re: Is it possible to change the default "Internal Error" message?

    ‏2013-07-26T16:26:59Z  
    • HermannSW
    • ‏2013-07-26T12:00:24Z

    > but our client is more interested on changing the default "Internal Error" message,
    > even before the request reaches a processing rule, like when you try to access a nonexistent URI for example...
    >

    "nonexistent URI" means that your policy does not have "catch all" rules (otherwise there would be no nonexistent).

    In that case, you may add a catch all rule (eg. URL=*) as the very last Client2Server rule and return whatever you want by

    • <dp:reject>
    • and/or <xsl:message terminate="yes">

    In this case the response would not be generated by an error rule, but as described, rule processing cannot be avoided.

     

    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

    That makes sense! Thank you guys for the input!