nameko.exceptions

Attributes

Exceptions

ExtensionNotFound

Attribute not found.

RpcTimeout

Common base class for all non-exit exceptions.

ReplyQueueExpiredWithPendingReplies

Common base class for all non-exit exceptions.

ContainerBeingKilled

Container.spawn_worker() 启动 kill 序列时引发。

RemoteError

如果远程工作者发生异常,则在调用者处引发的异常。

BadRequest

Common base class for all non-exit exceptions.

MalformedRequest

Common base class for all non-exit exceptions.

MethodNotFound

Common base class for all non-exit exceptions.

IncorrectSignature

Common base class for all non-exit exceptions.

UnknownService

Common base class for all non-exit exceptions.

UnserializableValueError

Common base class for all non-exit exceptions.

ConfigurationError

Common base class for all non-exit exceptions.

CommandError

从子命令中引发,以将错误报告回用户。

ConnectionNotFound

Unknown websocket connection id

Functions

get_module_path(exc_type)

返回 exc_type 的点分模块路径,包括类名。

safe_for_serialization(value)

在准备将值序列化为 JSON 时进行转换。

serialize(exc)

self.exc 序列化为表示它的数据字典。

deserialize(data)

data 反序列化为异常实例。

deserialize_to_instance(exc_type)

装饰器,将 exc_type 注册为可反序列化为实例,而不是 RemoteError。参见 deserialize()

Module Contents

exception nameko.exceptions.ExtensionNotFound[源代码]

Bases: AttributeError

Attribute not found.

Initialize self. See help(type(self)) for accurate signature.

exception nameko.exceptions.RpcTimeout[源代码]

Bases: Exception

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception nameko.exceptions.ReplyQueueExpiredWithPendingReplies[源代码]

Bases: Exception

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception nameko.exceptions.ContainerBeingKilled[源代码]

Bases: Exception

Container.spawn_worker() 启动 kill 序列时引发。

入口点应捕获此异常,并作出反应,仿佛它们一开始就不可用,例如,RPC 消费者可能应重新排队该消息。

我们需要这个,因为在执行 Container.kill() 时,Eventlet 可能会让出控制权,从而使入口点在它们自己被杀死之前有机会执行。

Initialize self. See help(type(self)) for accurate signature.

nameko.exceptions.registry[源代码]
nameko.exceptions.get_module_path(exc_type)[源代码]

返回 exc_type 的点分模块路径,包括类名。

e.g.:

>>> get_module_path(MethodNotFound)
>>> "nameko.exceptions.MethodNotFound"
exception nameko.exceptions.RemoteError(exc_type=None, value='')[源代码]

Bases: Exception

如果远程工作者发生异常,则在调用者处引发的异常。

Initialize self. See help(type(self)) for accurate signature.

exc_type[源代码]
value[源代码]
message[源代码]
nameko.exceptions.safe_for_serialization(value)[源代码]

在准备将值序列化为 JSON 时进行转换。

对于字符串,映射和可迭代对象不进行操作,其条目被处理为安全;对于所有其他值,进行字符串化,如果失败则使用回退值。

nameko.exceptions.serialize(exc)[源代码]

self.exc 序列化为表示它的数据字典。

nameko.exceptions.deserialize(data)[源代码]

data 反序列化为异常实例。

如果 exc_path 值与注册为“可反序列化”的异常匹配,则返回该异常类型的实例。否则,返回一个描述发生异常的 RemoteError 实例。

nameko.exceptions.deserialize_to_instance(exc_type)[源代码]

装饰器,将 exc_type 注册为可反序列化为实例,而不是 RemoteError。参见 deserialize()

exception nameko.exceptions.BadRequest[源代码]

Bases: Exception

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception nameko.exceptions.MalformedRequest[源代码]

Bases: BadRequest

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception nameko.exceptions.MethodNotFound[源代码]

Bases: BadRequest

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception nameko.exceptions.IncorrectSignature[源代码]

Bases: BadRequest

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception nameko.exceptions.UnknownService(service_name)[源代码]

Bases: Exception

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

_service_name[源代码]
__str__()[源代码]

Return str(self).

exception nameko.exceptions.UnserializableValueError(value)[源代码]

Bases: Exception

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

__str__()[源代码]

Return str(self).

exception nameko.exceptions.ConfigurationError[源代码]

Bases: Exception

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception nameko.exceptions.CommandError[源代码]

Bases: Exception

从子命令中引发,以将错误报告回用户。

Initialize self. See help(type(self)) for accurate signature.

exception nameko.exceptions.ConnectionNotFound[源代码]

Bases: BadRequest

Unknown websocket connection id

Initialize self. See help(type(self)) for accurate signature.