abstraction level of error handling

This is a discussion on abstraction level of error handling within the c++ forums in Programming Languages category; Hi everyone, I'm reading "The C++ Programming Language" (Bjarne Stroustrup, 3rd edition). At page 193, he said "Doing error handling using the same level of abstraction as the code that caused the error is hazardous; the error-handling code might repeat the same error that triggered the error handling in the first place", and I don't understand it clearly. So it would be very nice if someone here can explain it more clearly. Thanks in advance. -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ]...

Go Back   Application Development Forum > Programming Languages > c++

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-06-2008, 12:29 PM
nguyenminhhai
Guest
 
Default abstraction level of error handling

Hi everyone, I'm reading "The C++ Programming Language" (Bjarne
Stroustrup, 3rd edition). At page 193, he said "Doing error handling
using the same level of abstraction as the code that caused the error
is hazardous; the error-handling code might repeat the same error that
triggered the error handling in the first place", and I don't
understand it clearly. So it would be very nice if someone here can
explain it more clearly. Thanks in advance.

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Reply With Quote
  #2  
Old 09-06-2008, 08:03 PM
Le Chaud Lapin
Guest
 
Default Re: abstraction level of error handling

On Sep 6, 11:29 am, nguyenminhhai <nguyenminhhai2...@gmail.com> wrote:
> Hi everyone, I'm reading "The C++ Programming Language" (Bjarne
> Stroustrup, 3rd edition). At page 193, he said "Doing error handling
> using the same level of abstraction as the code that caused the error
> is hazardous; the error-handling code might repeat the same error that
> triggered the error handling in the first place", and I don't
> understand it clearly. So it would be very nice if someone here can
> explain it more clearly. Thanks in advance.


Hi,

Let's say you have client/server application between machines A and B.
Every now and then, there is some type of mysterious network error
between A and B that breaks connection between communicating processes
amond them. Exception is thrown and caught. You decided early on not
to scare user with any error messages on screen, so you send errors to
3rd server C and store them in database for review later, along with
all types of exceptions. Only, in this particular case, the connection
between C is also broken due to same problem that broke connection
between A and B. Exception gets thrown again.

Now what?

-Le Chaud Lapin-



--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 06:56 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.