Make use of actual exception objects

Untested due to lack of time, will test later today.