List of Messages...

Hi All,

Is it possible to get a list of all messages that an Exception will give when called getMessage() method?

I am working in a small application and i want to give the users my own messages when exception occurs.

For Example, When exp.getMessage() returns "Null Pointer Exception", i want to display my own message instead of this.

Any ideas?

Thanks,

Venkat

[407 byte] By [nvraman_83a] at [2007-11-27 5:05:38]
# 1
> Is it possible to get a list of all messages that an> Exception will give when called getMessage() method?like the "getMessage" method? There is only one message.Consider reading the API docs for Exceptions about what else you can get.
CeciNEstPasUnProgrammeura at 2007-7-12 10:24:09 > top of Java-index,Java Essentials,Java Programming...
# 2

Thank you for the reply.

I was not clear with my question. Sorry for that.

I want a list of all the messages that the getMessage() method will return.

For example "Null Pointer Exception", "IndexArrayOutofBoundException", etc...

Am I clear atleast now?

Thanks

Venkat

nvraman_83a at 2007-7-12 10:24:09 > top of Java-index,Java Essentials,Java Programming...
# 3
> Am I clear atleast now?No. Because those messages could be whatever the creator of the exception set it to be. The text can even be generated at runtime.
CeciNEstPasUnProgrammeura at 2007-7-12 10:24:09 > top of Java-index,Java Essentials,Java Programming...
# 4

Just a thought: your users should not be getting messages like "Null Pointer Exception" - or some translation thereof. (At any rate, it annoys me to get messages like this from software.)

Rather your program should be responding to events (including exceptions) that are significant to it and to its users. It might be a good idea for error messages to reflect this and be couched in terms that the user can appreciate. In this case there will be no simple 1-1 correspondence between Exceptions and the error messages that might (or might not) result. Even if you could determine what all those messages might be (which you can't for the reasons Ceci gave)

pbrockway2a at 2007-7-12 10:24:09 > top of Java-index,Java Essentials,Java Programming...
# 5
>The text can even be generated at runtime. Thanks for the reply. This gives me the answer.
nvraman_83a at 2007-7-12 10:24:09 > top of Java-index,Java Essentials,Java Programming...