Skip to content

Prettier Stata error handling #22

Closed
@hugetim

Description

@hugetim

Currently, running list, nobs results in this error message:

Exception in thread Stata:
Traceback (most recent call last):
  File "C:\Users\tjhuegerich\AppData\Local\Continuum\anaconda3\envs\pystata-jupyter\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Program Files\Stata17/utilities\pystata\core\stout.py", line 169, in run
    raise SystemError(output)
SystemError: option nobs not allowed
r(198);

Preferably, it would instead display the more Stata-like message:

option nobs not allowed
r(198);

Unfortunately, it doesn't appear possible to catch the SystemError raised by pystata in the way I expected. It is instead caught by the "threading.py" code referred to in the traceback. So I'm stumped on how to proceed, myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions