Type hint correct exception