Added a simple exception handler.

To be continued..