Improved exceptions and reporting exceptions for command-line compiler.

If you would create it as a template, you could use it also for Declaration error, ...