| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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! ] |
|
#2
| |||
| |||
| 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! ] |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.