MA-1084 #time 1h Implemented better exception handling and added unit
tests for said exception handling