Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT]: Better error handling with more verbose error messages #315

Closed
nfelt14 opened this issue Sep 26, 2024 · 6 comments
Closed

[FEAT]: Better error handling with more verbose error messages #315

nfelt14 opened this issue Sep 26, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request SCPI Standard Commands for Programmable Instruments TSP Test Script Processing

Comments

@nfelt14
Copy link
Collaborator

nfelt14 commented Sep 26, 2024

Description

It would be nice if the failures printed out by methods similar to query_response() could print out a little more information and use some common code for raising and formatting errors.

Additional Information

No response

@nfelt14 nfelt14 added enhancement New feature or request SCPI Standard Commands for Programmable Instruments TSP Test Script Processing labels Sep 26, 2024
@nfelt14 nfelt14 self-assigned this Oct 10, 2024
@nfelt14 nfelt14 added the WIP Work In Progress label Jan 8, 2025
@nfelt14
Copy link
Collaborator Author

nfelt14 commented Jan 8, 2025

The goal here is to make all errors and most exceptions easier to understand for the end-user.

@nfelt14
Copy link
Collaborator Author

nfelt14 commented Jan 8, 2025

As well as reduce the amount of "noise" in the errors. Some of them will need to be made smaller.

@nfelt14
Copy link
Collaborator Author

nfelt14 commented Jan 8, 2025

Things to do:

  1. Add more information about solutions/debugging/etc. to areas that are known to be more error prone (connection, write/query, etc.)
  2. catch errors and remove "noise", just keep the information we need

@nfelt14
Copy link
Collaborator Author

nfelt14 commented Jan 8, 2025

One idea is to pipe the stacktrace of the third-party libraries (pyvisa, etc.) into the log file with the DEBUG logging level. Then the stdout/stderr could just show the understandable error/exception message.

This only applies to the areas where we know there are bound to be errors, since this is Python, it isn't possible to account for all potential uncaught exceptions.

@nfelt14
Copy link
Collaborator Author

nfelt14 commented Jan 15, 2025

Areas of code to work on:

  • connection
  • write
  • query
  • read
  • set_and_check
  • query_response (and other similar methods)
  • logging configuration (provide an opt-out of the exception logging)

@nfelt14
Copy link
Collaborator Author

nfelt14 commented Jan 22, 2025

Released in v3.1

@nfelt14 nfelt14 closed this as completed Jan 22, 2025
@nfelt14 nfelt14 removed the WIP Work In Progress label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SCPI Standard Commands for Programmable Instruments TSP Test Script Processing
Projects
None yet
Development

No branches or pull requests

1 participant