Issue #24102: Fixed exception type checking in standard error handlers.