LibraryOfCongress / bagit-python

Work with BagIt packages from Python.
http://libraryofcongress.github.io/bagit-python
213 stars 85 forks source link

More detail desired for error messages #147

Open jamiepb opened 3 years ago

jamiepb commented 3 years ago

Hello,

It appears to me that if an error is raised, it only contains details if it gets past the Payload-Oxum check - is that correct? If I have a bag that is missing a file, I get an error such as "Payload-Oxum validation failed. Expected 4 files and 2865126 bytes but found 3 files and 2864947 bytes". However I would also like to know which file is missing. I tried using a script to catch the BagValidationError and print the details for this example, as suggested in the documentation for using BagIt in programs, but the details list is empty so it doesn't look like the code to to the step of generating an instance of the FileMissing type. Bagger will tell you which file is missing from the bag, which I think is helpful information. That said I am a Python novice so I may be missing something. Thank you for clarifying.

Jamie

kieranjol commented 2 years ago

I would also like this feature, it would help to figure out where the issue is.

PhoebeDoyle commented 2 years ago

I've had the same issue as the original poster - whenever I tried to make an intentional error with BagIt (i.e. editing text within bag, moving file outside of bag) in order to generate a "missing file error" and "fixity error", the only information I received was the expected file and byte size. There was no information provided on which files were missing/changed. I'm fairly new to BagIt and Python, but I believe I have followed all of the necessary steps for this information to appear, so I imagine this is an issue with the application itself.

finoradin commented 2 months ago

I might be wrong but I believe this is realted to https://github.com/LibraryOfCongress/bagit-python/pull/174 I found that the module was always defaulting to fast validation even when that option wasn't passed