act_errors

Create an act_errors dictionary with the values being Actifio exceptions. The use case being you can catch individual exceptions instead of making comparisons on the caught generic exception, without requiring star imports. Also, most users are more familiar with error codes than exception names, so referencing with a number is better.

Allows this logic:
except act_errors[10016]:
<handle exception>
except act_errors[8675309]:
<handle Jenny>
to replace this:
except ACTError:
if int(e.errorcode) == 10016:
<handle exception>
elif int(e.errorcode) == 8675309:
<handle Jenny>
else:
raise

This also improves the legibility of handling several possible ACTErrors of a try block.

Module Contents

Classes

ACTError(self,response_obj,*args,**kwargs)
class ACTError(response_obj, *args, **kwargs)
__init__(response_obj, *args, **kwargs)
__str__()