Search code examples
user-interfaceexceptionguidewire

Guidewire Exception handling in UI


when internal Guidewire code throws an exception you get a nicely formatted error message box. However, when custom code throws an exception you are directed to the error page (with the red stack trace text & back to application button). Is there anything in the Guidewire framework to make proper UI handling of errors nicer?

such as: < TextBox value="user.someMethod()"/>

//someMethod code...
try{
    return user.someOtherCode()
}catch(e : Exception){
    //TODO: gracefully display erorr mesage on page
    //e.g.   showErrorMessage()
    return null
}

Solution

  • You have a simpler way to do this,

    The below piece of code can be written in helper class or any Enhancement or even in PCF code tab, this will return a nice formatted error message.

    gw.api.util.LocationUtil.addRequestScopedErrorMessage("Your error message")