473,587 Members | 2,324 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1745
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(My message(errorre ading)).

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.celisATg etronics.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.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 (useErrorTextRo utine( "myspecificerro r") )

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******** ******@TK2MSFTN GP10.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 (useErrorTextRo utine( "myspecificerro r") )

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.celisATg etronics.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.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 (useErrorTextRo utine( "myspecificerro r") )

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

useErrorTextRou tine reads an XML file and gives from that my message that
has to do with "myspecificerro r" 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******** ******@tk2msftn gp13.phx.gbl...
Hi EricJ,
messagebox.show (useErrorTextRo utine( "myspecificerro r") )


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

useErrorTextRou tine reads an XML file and gives from that my message that
has to do with "myspecificerro r" 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
2857
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 return code (not generating error/exception) so it is more compatible with other programming language.
6
2330
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 assemblies are loaded before shutting down. In one case, some of my DB-accessing code didn't handle a NULL value properly. But try...catch wouldn't...
7
5980
by: Noor | last post by:
please tell the technique of centralize exception handling without try catch blocks in c#.
3
2742
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 exception handling mechanism which will allow me to pass character information about an error and its location from lower-level classes. Can you...
2
2588
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 Layer. My questions is where should I put exception handling: 1) Should it be put in all significant methods in all layers? 2) Should I create an...
9
2530
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 the way of CPU usage), compared to the "normal" practise returning values. How true is this? Will using using exception handling, in general, be...
44
4198
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 user tasks should always be included in a try/catch block that actually handles any exceptions that occur (log the exception, display a message box,...
4
5121
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 .NET 2003\Vc7\include\xstring(1453) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
41
3039
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 handle all of them. I don't care about which one happened, except to write out exception.Message to a log file. It seems verbose to write out...
1
3096
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
7843
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8206
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2353
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.