Custom Exceptions¶
The render_error() function can be used to render
multi-line error messages with stem.util.term colours.
The darc project provides following custom exceptions:
Note
All exceptions are inherited from _BaseException.
The darc project provides following custom warnings:
Note
All warnings are inherited from _BaseWarning.
-
exception
darc.error.APIRequestFailed[source]¶ Bases:
darc.error._BaseWarningAPI submit failed.
-
exception
darc.error.DatabaseOperaionFailed[source]¶ Bases:
darc.error._BaseWarningDatabase operation execution failed.
-
exception
darc.error.FreenetBootstrapFailed[source]¶ Bases:
darc.error._BaseWarningFreenet bootstrap process failed.
-
exception
darc.error.HookExecutionFailed[source]¶ Bases:
darc.error._BaseWarningFailed to execute hook function.
-
exception
darc.error.I2PBootstrapFailed[source]¶ Bases:
darc.error._BaseWarningI2P bootstrap process failed.
-
exception
darc.error.LinkNoReturn(link=None, *, drop=True)[source]¶ Bases:
darc.error._BaseExceptionThe link has no return value from the hooks.
- Parameters
link (darc.link.Link) – Original link object.
drop (bool) –
- Keyword Arguments
drop – If drops the
linkfrom task queues.- Return type
-
exception
darc.error.LockWarning[source]¶ Bases:
darc.error._BaseWarningFailed to acquire Redis lock.
-
exception
darc.error.RedisCommandFailed[source]¶ Bases:
darc.error._BaseWarningRedis command execution failed.
-
exception
darc.error.SiteNotFoundWarning[source]¶ Bases:
darc.error._BaseWarning,ImportWarningSite customisation not found.
-
exception
darc.error.TorBootstrapFailed[source]¶ Bases:
darc.error._BaseWarningTor bootstrap process failed.
-
exception
darc.error.TorRenewFailed[source]¶ Bases:
darc.error._BaseWarningTor renew request failed.
-
exception
darc.error.UnsupportedLink[source]¶ Bases:
darc.error._BaseExceptionThe link is not supported.
-
exception
darc.error.UnsupportedPlatform[source]¶ Bases:
darc.error._BaseExceptionThe platform is not supported.
-
exception
darc.error.UnsupportedProxy[source]¶ Bases:
darc.error._BaseExceptionThe proxy is not supported.
-
exception
darc.error.WorkerBreak[source]¶ Bases:
darc.error._BaseExceptionBreak from the worker loop.
-
exception
darc.error.ZeroNetBootstrapFailed[source]¶ Bases:
darc.error._BaseWarningZeroNet bootstrap process failed.
-
darc.error.render_error(message, colour)[source]¶ Render error message.
The function wraps the
stem.util.term.format()function to provide multi-line formatting support.- Parameters
message (AnyStr) – Multi-line message to be rendered with
colour.colour (stem.util.term.Color) – Front colour of text, c.f.
stem.util.term.Color.
- Returns
The rendered error message.
- Return type