Return correct exception type