views:

29

answers:

1

I'm interested in the different ways warnings and errors are (and could be) handled in programming languages. As far as I know, the only language-level error/warning functionality are the following:

  • compiler errors/warnings (which can be created by programmers using compiler commands, usually compiler specific)
  • console errors that can be redirected to a file - eg stderr in C-like langauges
  • throwable exception objects using explicit exception classes (like in java)
  • simple string exceptions (like in php and javascript, e.g. throw("Dental error");

Are there other structures I haven't mentioned? What other kind of language-level functionality do you think should exist / could be useful?

My first through is to use exception-like structures for both, where an uncaught warning would be logged in a flat file (or brought up at compile-time if the compiler can prove it will happen). I can't decide whether its a good idea to force methods to explicitly handle exceptions, or if they should be allowed to "bubble up".

What error and warning handling structures and ideas are there out there?

A: 

Perhaps break to debugger?

stusmith

related questions