-
Notifications
You must be signed in to change notification settings - Fork 13
Handle file/index not found errors in reader classes gracefully instead of segfaulting! #337
Handle file/index not found errors in reader classes gracefully instead of segfaulting! #337
Conversation
…ad of segfaulting! This has been a common complaint against gamgee of late, and with very good reason! Resolves #336
|
||
namespace gamgee { | ||
|
||
/** | ||
* @brief Exception for the case where there is an error opening a file for reading/writing | ||
*/ | ||
class FileOpenException : public std::runtime_error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any good reason not to call this FileNotFoundException?
maybe archaic english concordance, or something I'm unaware of :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it's for general file open errors, not ONLY file not found (htslib does not allow us to distinguish file not found from other types of file access errors)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question is does it really matter what the error was? we are not even distinguishing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's important for the name of the exception not to be deceiving -- it shouldn't be called FileNotFoundException if it can be thrown when a file is present (but unreadable).
After looking at the code, I'm okay with the 4 new exception classes. They are fine and if we choose to change them in the future, it is easy to do. Please create the 2 tickets requested above ^^. Other than that, this is good to merge. Good work. |
…segfaults_on_nonexistent_files Handle file/index not found errors in reader classes gracefully instead of segfaulting!
👍 |
This has been a common complaint against gamgee of late, and
with very good reason!
Resolves #336