john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

o2exceptions

#-*- 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()

  • « o2lib
  • atmos bash script sha1 check create sha1 file upload »

Published

Mar 9, 2013

Category

python-oxygencloud-snapshot

~62 words

Tags

  • o2exceptions 1
  • python 180
  • snapshot 12