Exemple #1
0
def _main():
    """Main entry point.

    """
    # Run web service.
    try:
        APP.run()

    # Handle unexpected exceptions.
    except Exception as err:
        # Ensure that web-service is stopped.
        try:
            APP.stop()
        except:
            pass

        # Ensure that all active db transactions are cancelled.
        try:
            APP.db.session.rollback()
        except:
            pass

        # Simple log to stdout.
        print err

    # Signal exit.
    finally:
        sys.exit()
Exemple #2
0
def _main():
    """Main entry point.

    """
    try:
        esdoc_api.run()
    except Exception as err:
        print err
        try:
            esdoc_api.stop()
        except:
            pass
        try:
            esdoc_api.db.session.rollback()
        except:
            pass
    finally:
        sys.exit()
Exemple #3
0
def _main():
    """Main entry point.

    """
    try:
        esdoc_api.run()
    except Exception as err:
        print err
        try:
            esdoc_api.stop()
        except:
            pass
        try:
            esdoc_api.db.session.rollback()
        except:
            pass
    finally:
        sys.exit()