rtkit.comment

exception rtkit.comment.RTCreated(msg)[source]

Bases: exceptions.Exception

Created Exception

args
message
exception rtkit.comment.RTNoMatch[source]

Bases: exceptions.Exception

No Match Exception

args
message
rtkit.comment.check(section)[source]

Parse and Dispatch Errors

See also

The rtkit.errors module

>>> check(['# Unknown object type: spam'])
Traceback (most recent call last):
        ...
RTUnknownTypeError: Unknown object type: spam
>>> check(["# Invalid object specification: 'spam'"])
Traceback (most recent call last):
        ...
RTInvalidError: Invalid object specification: 'spam'
>>> check(['# spam 1 does not exist.'])
Traceback (most recent call last):
        ...
RTNotFoundError: spam 1 does not exist
>>> check(['# No spam named ham exists.'])
Traceback (most recent call last):
        ...
RTNotFoundError: No spam named ham exists
>>> check(['# Objects of type eggs must be specified by numeric id.'])
Traceback (most recent call last):
        ...
RTValueError: Objects of type eggs must be specified by numeric id
>>> check(['No matching results.'])
Traceback (most recent call last):
        ...
RTNoMatch: No matching results
>>> check(['# Could not create ticket.', '# Could not create ticket. Queue not set'])
Traceback (most recent call last):
        ...
RTInvalidError: Could not create ticket. Queue not set
>>> try:
...     check(['# Ticket 1 created.'])
... except RTCreated as e:
...     e.id
'ticket/1'
>>> check(['# You are not allowed to modify ticket 2.'])
Traceback (most recent call last):
        ...
RTUnauthorized: You are not allowed to modify ticket 2