See the discussion on #2174. An uncaught C++ error on main causes an error like:
```
TypeError: Cannot create property 'pyodide_fatal_error' on number '28811048'
```
With this the same error looks like:
```
Pyodide has suffered a fatal error. Please report this to the Pyodide maintainers.
The cause of the fatal error was:
CppException: Unable to cast Python instance to C++ type (compile in debug mode for details)
```
Support for C++ exceptions in packages. See the discussion on #2174. An uncaught C++ error on main causes an error like:
```
TypeError: Cannot create property 'pyodide_fatal_error' on number '28811048'
```
With this the same error looks like:
```
Pyodide has suffered a fatal error. Please report this to the Pyodide maintainers.
The cause of the fatal error was:
CppException: Unable to cast Python instance to C++ type (compile in debug mode for details)
```
exclude: '^.*patches|.*\.cgi$'
default_language_version:
  python: "3.9"
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.3.0
    hooks:
      - id: check-yaml
      - id: end-of-file-fixer
      - id: trailing-whitespace
  - repo: https://github.com/psf/black
    rev: 20.8b1
    hooks:
      - id: black
  - repo: https://gitlab.com/pycqa/flake8
    rev: 3.7.8
    hooks:
      - id: flake8
        types: [file, python]
        # only check for unused imports, as the rest is done by black
        args: [--select=F401]
  - repo: https://github.com/pre-commit/mirrors-mypy
    rev: v0.812
    hooks:
      - id: mypy
        args:
          - --ignore-missing-imports
  - repo: local
    hooks:
      - id: clang-format
        name: clang-format-6.0
        language: system
        entry: ./tools/clang-format-precommit.sh

  - repo: https://github.com/pre-commit/mirrors-prettier
    rev: "v2.3.2" # Use the sha / tag you want to point at
    hooks:
      - id: prettier

exclude: '^.*patches|.*\.cgi$'
default_language_version:
  python: "3.9"
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.3.0
    hooks:
      - id: check-yaml
      - id: end-of-file-fixer
      - id: trailing-whitespace
  - repo: https://github.com/psf/black
    rev: 20.8b1
    hooks:
      - id: black
  - repo: https://gitlab.com/pycqa/flake8
    rev: 3.7.8
    hooks:
      - id: flake8
        types: [file, python]
        # only check for unused imports, as the rest is done by black
        args: [--select=F401]
  - repo: https://github.com/pre-commit/mirrors-mypy
    rev: v0.812
    hooks:
      - id: mypy
        args:
          - --ignore-missing-imports
  - repo: local
    hooks:
      - id: clang-format
        name: clang-format-6.0
        language: system
        entry: ./tools/clang-format-precommit.sh

  - repo: https://github.com/pre-commit/mirrors-prettier
    rev: "v2.3.2" # Use the sha / tag you want to point at
    hooks:
      - id: prettier
