When reading the __appsignal__.py configuration file from the demo or diagnose command, handle unexpected errors in the file (e.g. syntax errors) instead of only handling the expected error of the appsignal variable being missing.
Unify the handling of errors when reading a config file. Provide an ExitError that can be raised by command helpers to trigger the command to exit.
Since loading the configuration file is only done by the diagnose and demo commands, move that functionality out of the Client file and into a helper for the CLI commands.
This Pull Request does not include a changeset. Add a changeset if the change impacts users and should be included in the changelog upon release. Read more about changesets. Ignore this rule by adding [skip changeset] to your Pull Request body. - (More info)
When reading the
__appsignal__.py
configuration file from the demo or diagnose command, handle unexpected errors in the file (e.g. syntax errors) instead of only handling the expected error of theappsignal
variable being missing.Unify the handling of errors when reading a config file. Provide an
ExitError
that can be raised by command helpers to trigger the command to exit.Since loading the configuration file is only done by the diagnose and demo commands, move that functionality out of the
Client
file and into a helper for the CLI commands.