Custom Error Message / Alternative to FORMATTED MESSAGES

I need to be able to display a custom, simple, error message should an unanticipated JSF error occur – say IS is down, or something.

I plan to hide the “Formatted Messages” control for all but Admins, so how can I tell if an error occurred in order to write a “contact your administrator” string to the UI for everyone else?

Any help is appreciated!!

Lucas.

Not sure what this generic error message is supposed to be but I would imagine that you are trying to detect this on the MWS side since you are trying to detect IS being down. It would probably fall into the category of Expection where you want a try catch around that and throw it based upon user role that is currently logged in.

I want to detect errors that the FORMATTED MESSAGES box displays.

If I get a SOAP error, for example, I don’t want the user to see it (and the stack trace). I want to detect that it happened and display a generic “contact your admin” message.

Lucas.

That would mean for every call that you post to IS you want to transform the error message to ‘Contact System Admin’ and put the real message to a log file. I don’t know if this is feasible at your level but more of an system design level which the WM guys would need to best suggest how to generically override any such messages oppose to manually trying to capture it at every call you do to is.

I’m not worried about IS interaction, that I can mange, I’m worried about JSF errors that do not originate from IS.

For web Service clients (e.g. calling into IS services) you can use Error Handers (found in the Pallette under Data > Error Handlers). You can attach an error handler to a web service client and it will trap any exception error coming out of it and can display a nice friendly error message instead in your application or redirect to a different page etc.

Please see wm_coreproviderstest sample from CAF samples available on www.ajax-softwareag.com

As for exceptions coming from just general Java code you will need to ensure to catch all exceptions and manually add JSF messages to FacesContext to report these errors in a custom way.

Thanks Alex. I’ll go off to digest this.