• Mayank Mittal's avatar
    Adds try-catch in all the scripts for safe app closing (#185) · 07fc74d2
    Mayank Mittal authored
    # Description
    
    Propogates the try-except-finally paradigm from the unit tests to all
    the scripts. This ensures a cleaner exit of the script and allows a
    better traceback print.
    
    ```python
    import traceback
    
    import carb
    
    if __name__ == "__main__":
        try:
            # Run the main function
            main()
        except Exception as err:
            carb.log_error(err)
            carb.log_error(traceback.format_exc())
            raise
        finally:
            # close sim app
            simulation_app.close()
    ```
    
    ## Type of change
    
    - New feature (non-breaking change which adds functionality)
    - This change requires a documentation update
    
    ## Checklist
    
    - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
    `./orbit.sh --format`
    - [ ] I have made corresponding changes to the documentation
    - [x] My changes generate no new warnings
    - [ ] I have added tests that prove my fix is effective or that my
    feature works
    - [ ] I have updated the changelog and the corresponding version in the
    extension's `config/extension.toml` file
    07fc74d2
Name
Last commit
Last update
.github Loading commit data...
.vscode Loading commit data...
docker Loading commit data...
docs Loading commit data...
source Loading commit data...
.dockerignore Loading commit data...
.flake8 Loading commit data...
.gitignore Loading commit data...
.pre-commit-config.yaml Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
VERSION Loading commit data...
orbit.sh Loading commit data...
pyproject.toml Loading commit data...