Errors
tibiawikisql.errors
¶
Custom exceptions used by the package.
Classes:
| Name | Description |
|---|---|
TibiaWikiSqlError |
Base class for all exceptions raised by tibiawiki-sql. |
AttributeParsingError |
Error raised when trying to parse an attribute. |
ArticleParsingError |
Error raised when an article failed to be parsed. |
TemplateNotFoundError |
Error raised when the required template is not found in the article. |
DatabaseError |
Error raised when a database related error happens. |
InvalidColumnValueError |
Error raised when an invalid value is assigned to a column. |
SchemaError |
Error raised for invalid schema definitions. |
AttributeParsingError
¶
Bases: TibiaWikiSqlError
Error raised when trying to parse an attribute.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cause
|
type[Exception]
|
The exception that caused this. |
required |
Source code in tibiawikisql/errors.py
ArticleParsingError
¶
ArticleParsingError(
article: Article,
msg: str | None = None,
cause: type[Exception] | None = None,
)
Bases: TibiaWikiSqlError
Error raised when an article failed to be parsed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
article
|
Article
|
The article that failed to parse. |
required |
msg
|
str | None
|
An error message for the error. |
None
|
cause
|
type[Exception] | None
|
The original exception that caused the parsing to fail. |
None
|
Source code in tibiawikisql/errors.py
TemplateNotFoundError
¶
TemplateNotFoundError(
article: Article, parser: type[BaseParser]
)
Bases: ArticleParsingError
Error raised when the required template is not found in the article.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
article
|
Article
|
The article that failed to parse. |
required |
parser
|
type[BaseParser]
|
The parser class used. |
required |
Source code in tibiawikisql/errors.py
DatabaseError
¶
Bases: TibiaWikiSqlError
Error raised when a database related error happens.
InvalidColumnValueError
¶
Bases: TibiaWikiSqlError
Error raised when an invalid value is assigned to a column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
type[Table]
|
The table where the column is located. |
required |
column
|
Column
|
The column with the error. |
required |
message
|
str
|
A brief description of the error. |
required |
Source code in tibiawikisql/errors.py
SchemaError
¶
Bases: DatabaseError
Error raised for invalid schema definitions.
Notes
This error is raised very early when running, to verify that classes are defined correctly, so it is not an error that should be seen when using the library.