Close
    logoCloudomation Docs

    Exceptions

    Cloudomation uses exceptions to handle the life of an execution. Actions such as deleting or cancelling an execution will result in an exception in the execution.

    These exceptions are not catchable, consider a simple flow script:

    import flow_api
    def handler(system: flow_api.System, this: flow_api.Execution):
    try:
    this.sleep(60)
    except:
    this.log('caught general exception')
    finally:
    this.log('in finally block')
    return this.success('all done')

    The outputs of this script will look like this, when pressing cancel within the sleep duration (note the absence of the line "caught general exception"):

    logging:
    - '2021-04-12 14:13:33':
    - in finally block

    Other kinds of exceptions of course stay catchable just like normal:

    import flow_api
    def handler(system: flow_api.System, this: flow_api.Execution):
    try:
    system.file('i-do-not-exist').get('content')
    except:
    this.log('caught general exception')
    finally:
    this.log('in finally block')
    return this.success('all done')

    Will give this log output:

    logging:
    - '2021-04-12 14:18:30':
    - caught general exception
    - '2021-04-12 14:18:30':
    - in finally block
    Knowledge Base — Previous
    Connection Resource
    Next — Knowledge Base
    Executions