Exception handling

  • Thread starter Thread starter Jay
  • Start date Start date
J

Jay

Hi,

I'm developing an windows application in VB.net.
The people who will use this app all speak Dutch.

Whenever an exception occurs I want to show a user friendly message to the
user while
the message in english is logged in a text file.
This user friendly message should define, in simple words if possible, what
the problem is.
And, of course, it should be displayed in Dutch!

For now I have been thinking about using a resource file with a number of
common exception
types and their explanation in Dutch.
I would then look up the Dutch message and show it to the user.

First, I'm not sure if this is the way to go. I need almost every possible
exception type
in my resource file and I need to put the correct message in there aswell.

Second, if this is the way to go, is there a list of common exceptions for
the framework
available without having to browse through the object browser.

So, if someone could tell if there is a far better way to do this or give me
some help in any
way I would appreciate it.

Thanks

Jay
 
Hi Jay,

As far as I know is it if the user have set his computer language to Dutch
(with W'98 and ME using the keyboard language) and you uses the Dutch
version of the framework all messages except the one you put in your program
will be in Dutch.

When you want more languages you can use the Resx file, but that is only for
the standard text properties.

Therefore when you use only Dutch text in your program, is the text you use
the text showed to the user. If the language on the user computer is English
all standard will be in English and your texts in Dutch.

A nice approach to overcome that is making an XML file.

You can than put in your exception routine something as

message.show(Mymessage(errorreading)).

In that mymessage function you can check the language using the local
settings.

Just some thoughts.

Cor
 
my 2 cents

users generally don't like messages of the type found in ex.message.
personally i would catch the error put the ex.message in your log and
display a more general easy to understand message in a message box.
something like "problem w saving, please check your input and try again"
instaid of connection error or db error or invalid cast ... even if you
translate these users won't like them.

if you want different messages for different errors you can always catch
specific errors. you could use the lang settings as cor suggested but i'm
afraid that the message you would want to show is more dependant on the
actions of the user and where he is in your application than on the error it
self.

eric
 
Hi Eric and Jay,
if you want different messages for different errors you can always catch
specific errors. you could use the lang settings as cor suggested but i'm
afraid that the message you would want to show is more dependant on the
actions of the user and where he is in your application than on the error it
self.

I did not understand above because that was what I did mean, but I did not
place some quotes in my pseudo. This is better I think.

messagebox.show(useErrorTextRoutine( "myspecificerror") )

Or is it something else Eric?

:-)

Cor
 
Thanks for the advice.

By the way, the logging mechanism as described in the reply from Cor
has already found its way into my code. :-)

See ya

Jay
 
sorry, i started this post before you replied, before i posted i retrieved
the new posts and i only had a brief look at your post.

but i do mean something else, using your function would still give the
standard error messages (i think) and users generally dont like those
 
Hi EricJ,
">
but i do mean something else, using your function would still give the
standard error messages (i think) and users generally dont like those

No it is not

useErrorTextRoutine reads an XML file and gives from that my message that
has to do with "myspecificerror" back in the language from the culture
setting.

Not that difficult I thougth.

Cor
 
ok ok ;p
i misread you

Cor said:
Hi EricJ,


No it is not

useErrorTextRoutine reads an XML file and gives from that my message that
has to do with "myspecificerror" back in the language from the culture
setting.

Not that difficult I thougth.

Cor
 
Back
Top