-
Notifications
You must be signed in to change notification settings - Fork 25
Uncaught IllegalArgumentException (Skeleton and ogg page) #27
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
Comments
Based on https://wiki.apache.org/tika/ErrorsAndExceptions I'm tempted to say that the detailed exception should remain at the Would that be what you, as an end-user, expect? |
That would definitely satisfy my needs as an end-user. I'm definitely not the software design pattern engineering guy who could answer this question properly, but I try anyway: I think every library should probably declare the exceptions it could throw. I mean in the end it is this library's responsibility to communicate to tika which exceptions could be thrown. From that point of view I would say an entire file is indeed an argument to the ogg code, but usually an IllegalArgumentException is something I would expect when I specified a wrong argument. However, in this case the ogg code could read the file, but was just not happy with it's content. As stated in some discussions about this kind of things (e.g. https://stackoverflow.com/questions/15208544/when-should-an-illegalargumentexception-be-thrown ), IllegalArgumentException is usually something thrown when the programmer did something wrong (not the case here). So from that point of view I think throwing something else than IllegalArgumentException would be better. Another point I see is that catching a runtime exception as early as possible and throw some sane and excpected Exception that was declared to be thrown is a good idea. But please don't take my word, I'm not a programmer on a daily basis and I don't think about these things often enough :) |
…on) for formats we cannot handle (often corrupt files) #27
…ggDetector just decline to detect, rather than raising a runtime exception
In 3ea1afb I've changed the low-level code to throw an Does that look + work ok for you? |
That sounds like a good solution! I checked the code and from my point of view that makes sense and will work for me. |
…on) for formats we cannot handle (often corrupt files) Gagravarr#27
…he Tika OggDetector just decline to detect, rather than raising a runtime exception
Great, thanks for the help! |
…on) for formats we cannot handle (often corrupt files) Gagravarr#27
…he Tika OggDetector just decline to detect, rather than raising a runtime exception
…on) for formats we cannot handle (often corrupt files) Gagravarr#27
…he Tika OggDetector just decline to detect, rather than raising a runtime exception
…on) for formats we cannot handle (often corrupt files) Gagravarr#27
…he Tika OggDetector just decline to detect, rather than raising a runtime exception
During a fuzzing run with the AFL-based Kelinci fuzzer found at https://github.com/isstac/kelinci I found the two attached files result in IllegalArgumentException:
Shouldn't the library throw a more generic error message such as a parser error?
IllegalArgumentException.zip
The text was updated successfully, but these errors were encountered: