API: Catch Errors as well as Exceptions