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

Improve error reporting in some cases #550

Merged
merged 7 commits into from
Mar 26, 2024

Conversation

texasaggie97
Copy link
Collaborator

What does this Pull Request accomplish?

If for some reason the extended error message is blank, the DaqError ends up not showing any output when it is printed. This can happen if the DLL doesn't properly load plugins. If message is blank, try to put at least something in to the message that is then given to the parent Error class.

Changed DaqReadError and DaqWriteError to let DaqError handle setting the message

Why should this Pull Request be merged?

Improves error reporting

What testing has been done?

Local testing

src/handwritten/errors.py Outdated Show resolved Hide resolved
src/handwritten/errors.py Show resolved Hide resolved
src/handwritten/errors.py Outdated Show resolved Hide resolved
src/handwritten/errors.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@zhindes zhindes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woops, did a single comment before. see my comment about inverting the message order

Copy link

github-actions bot commented Mar 22, 2024

Test Results

    34 files  ±    0      34 suites  ±0   41m 33s ⏱️ + 1m 10s
 2 232 tests +  160   1 896 ✅ +  192    336 💤  -  32  0 ❌ ±0 
39 446 runs  +2 720  33 910 ✅ +3 264  5 536 💤  - 544  0 ❌ ±0 

Results for commit a41ab87. ± Comparison against base commit e902251.

This pull request removes 32 and adds 192 tests. Note that renamed tests count towards both.
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_str___shared_interpreter[grpc_init_kwargs-ai_physical_chans]
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_str___shared_interpreter[grpc_init_kwargs-ao_physical_chans]
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_str___shared_interpreter[grpc_init_kwargs-ci_physical_chans]
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_str___shared_interpreter[grpc_init_kwargs-co_physical_chans]
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_str___shared_interpreter[grpc_init_kwargs-di_lines]
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_str___shared_interpreter[grpc_init_kwargs-di_ports]
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_str___shared_interpreter[grpc_init_kwargs-do_lines]
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_str___shared_interpreter[grpc_init_kwargs-do_ports]
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_str___shared_interpreter[library_init_kwargs-ai_physical_chans]
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_str___shared_interpreter[library_init_kwargs-ao_physical_chans]
…
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_mixed_str_list___name[grpc_init_kwargs-ai_physical_chans]
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_mixed_str_list___name[grpc_init_kwargs-ao_physical_chans]
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_mixed_str_list___name[grpc_init_kwargs-ci_physical_chans]
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_mixed_str_list___name[grpc_init_kwargs-co_physical_chans]
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_mixed_str_list___name[grpc_init_kwargs-di_lines]
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_mixed_str_list___name[grpc_init_kwargs-di_ports]
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_mixed_str_list___name[grpc_init_kwargs-do_lines]
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_mixed_str_list___name[grpc_init_kwargs-do_ports]
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_mixed_str_list___name[library_init_kwargs-ai_physical_chans]
tests.component.system._collections.test_physical_channel_collection ‑ test___physical_channels___getitem_mixed_str_list___name[library_init_kwargs-ao_physical_chans]
…

♻️ This comment has been updated with latest results.

@texasaggie97 texasaggie97 dismissed stale reviews from zhindes and bkeryan March 22, 2024 20:56

Commets addressed

generated/nidaqmx/errors.py Outdated Show resolved Hide resolved
generated/nidaqmx/errors.py Outdated Show resolved Hide resolved
@texasaggie97 texasaggie97 dismissed bkeryan’s stale review March 25, 2024 13:54

Comments addressed

Copy link
Collaborator

@zhindes zhindes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit on the string when the description can't be found.

src/handwritten/errors.py Outdated Show resolved Hide resolved
texasaggie97 and others added 2 commits March 26, 2024 14:09
Co-authored-by: Zach Hindes <zach.hindes@ni.com>
@maxxboehme maxxboehme merged commit 44f2486 into master Mar 26, 2024
17 checks passed
@texasaggie97 texasaggie97 deleted the users/texasaggie97/better-error-reporting branch March 26, 2024 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants