using error messages

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?
 
A

Arne Vajhøj

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
 
A

Arne Vajhøj

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top