473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Exception handling

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
Nov 20 '05 #1
7 1718
Cor
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


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.

Nov 20 '05 #2
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

"Jay" <johan.celisATgetronics.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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

Nov 20 '05 #3
Cor
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
Nov 20 '05 #4
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

"Cor" <no*@non.com> wrote in message
news:Oi**************@TK2MSFTNGP10.phx.gbl...
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

Nov 20 '05 #5
Jay
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

"Jay" <johan.celisATgetronics.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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

Nov 20 '05 #6
Cor
Hi EricJ,
messagebox.show(useErrorTextRoutine( "myspecificerror") )

"> 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
Nov 20 '05 #7
ok ok ;p
i misread you

"Cor" <no*@non.com> wrote in message
news:Oi**************@tk2msftngp13.phx.gbl...
Hi EricJ,
messagebox.show(useErrorTextRoutine( "myspecificerror") )


">
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

Nov 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: adi | last post by:
Dear all, This is more like a theoretical or conceptual question: which is better, using exception or return code for a .NET component? I had created a COM object (using VB6), which uses...
6
by: Daniel Wilson | last post by:
I am having exception-handling and stability problems with .NET. I will have a block of managed code inside try...catch and will still get a generic ..NET exception box that will tell me which...
7
by: Noor | last post by:
please tell the technique of centralize exception handling without try catch blocks in c#.
3
by: Master of C++ | last post by:
Hi, I am an absolute newbie to Exception Handling, and I am trying to retrofit exception handling to a LOT of C++ code that I've written earlier. I am just looking for a bare-bones, low-tech...
2
by: tom | last post by:
Hi, I am developing a WinForm application and I am looking for a guide on where to place Exception Handling. My application is designed into three tiers UI, Business Objects, and Data Access...
9
by: C# Learner | last post by:
Some time ago, I remember reading a discussion about the strengths and weaknesses of exception handling. One of the weaknesses that was put forward was that exception handling is inefficient (in...
44
by: craig | last post by:
I am wondering if there are some best practices for determining a strategy for using try/catch blocks within an application. My current thoughts are: 1. The code the initiates any high-level...
4
by: Ele | last post by:
When Exception handling disabled compiler still spits out "C++ exception handler used." Why is that? Why does it ask for "Specify /EHsc"? Thanks! c:\Program Files\Microsoft Visual Studio...
41
by: Zytan | last post by:
Ok something simple like int.Parse(string) can throw these exceptions: ArgumentNullException, FormatException, OverflowException I don't want my program to just crash on an exception, so I must...
1
by: George2 | last post by:
Hello everyone, Such code segment is used to check whether function call or exception- handling mechanism runs out of memory first (written by Bjarne), void perverted() { try{
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.