Update exception handling with custom types, Ticket #216
fix after merge