Specify exception type to avoid infinite loop