-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
redesigned context-not-available error to follow the same principles …
…as other IQL errors, inherting from IQLError, thus enabled its handling by self-reflection mechanism
- Loading branch information
1 parent
273e217
commit 7f8b5f4
Showing
3 changed files
with
48 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,5 @@ | ||
from abc import ABC | ||
|
||
|
||
class BaseContextException(Exception, ABC): | ||
""" | ||
A base (abstract) exception for all specification context-related exception. | ||
""" | ||
|
||
|
||
class ContextNotAvailableError(Exception): | ||
""" | ||
An exception inheriting from BaseContextException pointining that no sufficient context information | ||
was provided by the user while calling view.ask(). | ||
""" | ||
|
||
|
||
class ContextualisationNotAllowed(Exception): | ||
""" | ||
An exception inheriting from BaseContextException pointining that the filter method signature | ||
does not allow to provide an additional context. | ||
""" | ||
|
||
|
||
# WORKAROUND - traditional inhertiance syntax is not working in context of abstract Exceptions | ||
BaseContextException.register(ContextNotAvailableError) | ||
BaseContextException.register(ContextualisationNotAllowed) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters