def load_db_driver(handler):
    try:
        # execute handler and commit changes if all is ok
        response = handler()
        db.commit()
        return response

    except web.HTTPError:
        # a special case: commit changes if http error ends with
        # 200, 201, 202, etc
        if web.ctx.status.startswith('2'):
            db.commit()
        else:
            db.rollback()
        raise

    except (sa_exc.IntegrityError, sa_exc.DataError) as exc:
        # respond a "400 Bad Request" if database constraints were broken
        db.rollback()
        raise BaseHandler.http(400, exc.message)

    except Exception:
        db.rollback()
        raise

    finally:
        db.remove()
Instantiate and return Action class instance.
dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/api/v1/handlers/base.py/load_db_driver--crossover with--dataset/ETHPy150Open StackStorm/st2/st2actions/st2actions/runners/utils.py/get_action_class_instance