2
from twisted.cred import error
4
# Authentication errors
5
class BadPassword(error.UnauthorizedLogin):
8
class NoSuchUser(error.UnauthorizedLogin):
12
# Base Imaginary error
13
class ImaginaryError(Exception):
17
# Input handling errors
18
class NoSuchCommand(ImaginaryError):
20
There is no command like the one you tried to execute.
23
class AmbiguousArgument(ImaginaryError):
25
One or more of the inputs specified can not be narrowed down to
26
just one thing. This can be due to the presence of multiple
27
things with similar names, or due to the absence of anything named
28
similarly to the given input.
30
@ivar action: The action which was being processed when an ambiguity was
34
@ivar part: The part of the command which was ambiguous.
35
Typically something like 'target' or 'tool'.
37
@type partValue: C{str}
38
@ivar partValue: The string which was supplied by the user for the indicated part.
40
@type objects: C{list} of C{IThing}
41
@ivar objects: The objects which were involved in the ambiguity.
44
def __init__(self, action, part, partValue, objects):
45
ImaginaryError.__init__(self, action, part, partValue, objects)
48
self.partValue = partValue
49
self.objects = objects
53
class ActionFailure(ImaginaryError):
55
Wrapper exception for an Event that caused an action to fail (such that the
56
transaction in which it was running should be reverted).
58
def __init__(self, event):
59
ImaginaryError.__init__(self)
64
return '<Action Failure: %r>' % (self.event,)
68
class ThingNotFound(ImaginaryError):
70
Resolving a Thing by identity failed.
75
class DoesntFit(ImaginaryError):
77
An object tried to go into a container, but the container was full.
81
class Closed(ImaginaryError):
83
An object tried to go into a container, but the container was closed.
87
class CannotMove(ImaginaryError):
89
An object tried to move but it was not portable so it couldn't.