how to print an error message?

Hi,

I'm working on a plugin for file import. When any problem occurs, it seems I have no mean to tell the user about it (apart from the log!)… or am I wrong? Is there a way to have a message printed to the user, for example when a ClientException is thrown?

Tx

Patrick

0 votes

1 answers

3144 views

ANSWER



Hi,

You can throw a RecoverableClientException from your own code. The first message param is the exception message, the second one, localizedMessage, is the label that will be used to display an i18n error feedback message.

This exception will be caught by the Seam layer to display an error feedback to the user.

0 votes



Hi,

The error message is indeed printed. But for the localized message, I put the key for a message I have in my l10n/ folder … but it is not printed, even though my interface is not in english!

06/24/2013

Nothing is displayed or the not i18n label is displayed?
06/24/2013

nothing is displayed.
06/24/2013

Could you show us your code (in a gist or pastebin or …)?
06/24/2013

Please fill an issue if you can provide a way to reproduce it (code sample, unit/integration or functional test, …).
07/17/2013