You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.
I'm a noob with log4j so if there is a way... well.
The archive constructors call readheaders eventually. There there is a log of alll exceptions:
WARNING: exception in archive constructor maybe file is encrypted or currupt
and a comment on that catch:
//ignore exceptions to allow exraction of working files in
//corrupt archive
In my data, there is one or two files that are corrupt/encrypted: that catch logs a NullPointerException (i didn't pass null). However, as it is a nullpointer, not a IOException, i don't have a file name (or indeed, i don't have anything to report to the user, because that the exception triggered is opaque to the code).
I'd prefer if this corner case was configurable, maybe by throwing a exception at the end of the constructor, documenting on it that you can still try using the archive for the non-corrupted parts, or a 'getError' or a similar scheme.
The text was updated successfully, but these errors were encountered:
The reason it is throwing NullPointerException is that UnrarHeadertype.findType is returning null for the byte marker it is sent. I'm handling this by installing a handler for the specific logger of the Archive class which wraps given throwables in a runtimeexception and throws them again, then they're caught on my libraray boundary and wrapped on a domain specific exception.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm a noob with log4j so if there is a way... well.
The archive constructors call readheaders eventually. There there is a log of alll exceptions:
WARNING: exception in archive constructor maybe file is encrypted or currupt
and a comment on that catch:
//ignore exceptions to allow exraction of working files in
//corrupt archive
In my data, there is one or two files that are corrupt/encrypted: that catch logs a NullPointerException (i didn't pass null). However, as it is a nullpointer, not a IOException, i don't have a file name (or indeed, i don't have anything to report to the user, because that the exception triggered is opaque to the code).
I'd prefer if this corner case was configurable, maybe by throwing a exception at the end of the constructor, documenting on it that you can still try using the archive for the non-corrupted parts, or a 'getError' or a similar scheme.
The text was updated successfully, but these errors were encountered: