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

Catch exception when trying to read corrupted data #157

Open
rodolakis opened this issue Jun 13, 2024 · 0 comments
Open

Catch exception when trying to read corrupted data #157

rodolakis opened this issue Jun 13, 2024 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@rodolakis
Copy link
Collaborator

Problem with old corrupted data (from 2017 at 29-ID). Need a try except to cash the exception and print the name of the corrupted file.

No MDA files found in the selected folder.
Traceback (most recent call last):
  File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/mainwindow.py", line 181, in onFolderSelected
    mda_list = [utils.get_file_info(f) for f in folder_path.glob("*.mda")]
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/mainwindow.py", line 181, in <listcomp>
    mda_list = [utils.get_file_info(f) for f in folder_path.glob("*.mda")]
                ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/utils.py", line 74, in get_file_info
    file_data = readMDA(str(file_path))[1]
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/synApps_mdalib/mda.py", line 790, in readMDA
    n = u.unpack_int()      # length of name string
        ^^^^^^^^^^^^^^
  File "/home/beams/RODOLAKIS/.conda/envs/mdaviz/lib/python3.11/xdrlib.py", line 171, in unpack_int
    raise EOFError
EOFError
Aborted (core dumped)
@rodolakis rodolakis added the bug Something isn't working label Jun 13, 2024
@rodolakis rodolakis added this to the v1.1 milestone Jun 13, 2024
@rodolakis rodolakis self-assigned this Jun 13, 2024
@rodolakis rodolakis added this to mdaviz Jun 13, 2024
@rodolakis rodolakis moved this to Next Release in mdaviz Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Next Release
Development

No branches or pull requests

1 participant