using error messages

  • Thread starter Thread starter aaron
  • Start date Start date
A

aaron

Do you think an entire application (or at least each class) should have a
'final' try-catch block setup for any unexpected errors that could occur? If
so, how would you set this up? Would you 'throw' the errors to the final
exception block?
If not can you tell me why you would not have a final try-catch block?
 
Do you think an entire application (or at least each class) should have a
'final' try-catch block setup for any unexpected errors that could occur?

Application : yes
Each class : no

Many (read: most) classes will not know how to handle an exception.
If
so, how would you set this up? Would you 'throw' the errors to the final
exception block?

Rethrowing is usually an API thing.
If not can you tell me why you would not have a final try-catch block?

Most places.

See above.

Arne
 
In unmanaged code, it's relatively simple to just pre-allocate
everything you need for error reporting, and then be assured that memory
allocations will only ever be attempted under the control of your own
program code.

In C one has a good feeling for memory allocation.

In C++ especially if it is a bit complex then it can
be difficult to understand where all the allocations
are happening.

Arne
 
Back
Top