Errors¶
The different types of errors defined in Gfapy are summarized in the
following table. All exception raised in the library are subclasses of
Error
. Thus, except gfapy.Error
can be use to catch
all library errors.
Error | Description | Examples |
---|---|---|
VersionError |
An unknown or wrong version is specified or implied | “GFA0”; or GFA1 in GFA2 context |
ValueError |
The value of an object is invalid | a negative position is used |
TypeError |
The wrong type has been used or specified | Z instead of i used for VN tag; Hash for an i tag |
FormatError |
The format of an object is wrong | a line does not contain the expected number of fields |
NotUniqueError |
Something should be unique but is not | duplicated tag name or line identifier |
InconsistencyError |
Pieces of information collide with each other | length of sequence and LN tag do not match |
RuntimeError |
The user tried to do something which is not allowed | editing from_segment field in connected links |
ArgumentError |
Problem with the arguments of a method | wrong number of arguments in dynamically created method |
AssertionError |
Something unexpected happened | there is a bug in the library or the library has been used in an unintended way |