#-*- coding:utf-8 -*-
# watch your nomenclature. make it compatible with 2.7 / 3.2
from lib.gen_py.errors.ttypes import *
class O2Exception( Exception ): # Umbrella case
pass
class O2UnexpectedException( O2Exception ):
pass
# Oxygen Backend API has 4 different exceptions.
def handle_exception( e ):
try:
raise e
except ApiRuleException as arx:
if arx.errorCode == 3:
pass
except ApiInvalidInputException as aiix:
raise O2UnexpectedException()
except ApiSystemsException as asx:
raise O2UnexpectedException()
except ApiUnexpectedException as aue:
raise O2UnexpectedException()