Revision 0efb43cd snf-cyclades-app/synnefo/plankton/utils.py

b/snf-cyclades-app/synnefo/plankton/utils.py
48 48
    image_backend = backend.get_backend()(user_id)
49 49
    try:
50 50
        yield image_backend
51
    except backend.Forbidden:
51
    except backend.Forbidden as e:
52 52
        raise faults.Forbidden
53 53
    except backend.ImageNotFound:
54 54
        raise faults.ItemNotFound
55
    except backend.InvalidMetadata as e:
56
        raise faults.BadRequest(str(e))
55 57
    finally:
56 58
        image_backend.close()

Also available in: Unified diff