Improved exceptions and reporting exceptions for command-line compiler.

Yes, so there is a point in dragging this inside the condition, but I still think it is better readable this way as the expression is quite long and involves namspaces and templates