check exception types before calling error handler
allow registration of exception-specific handlers