Package couchdbkit :: Module exceptions
[hide private]
[frames] | no frames]

Source Code for Module couchdbkit.exceptions

 1  # -*- coding: utf-8 - 
 2  # 
 3  # This file is part of couchdbkit released under the MIT license.  
 4  # See the NOTICE for more information. 
 5   
 6  """ 
 7  All exceptions used in couchdbkit. 
 8  """ 
 9  from restkit.errors import ResourceError 
10   
11 -class InvalidAttachment(Exception):
12 """ raised when an attachment is invalid """
13
14 -class DuplicatePropertyError(Exception):
15 """ exception raised when there is a duplicate 16 property in a model """
17
18 -class BadValueError(Exception):
19 """ exception raised when a value can't be validated 20 or is required """
21
22 -class MultipleResultsFound(Exception):
23 """ exception raised when more than one object is 24 returned by the get_by method"""
25
26 -class NoResultFound(Exception):
27 """ exception returned when no results are found """
28
29 -class ReservedWordError(Exception):
30 """ exception raised when a reserved word 31 is used in Document schema """
32
33 -class DocsPathNotFound(Exception):
34 """ exception raised when path given for docs isn't found """
35
36 -class BulkSaveError(Exception):
37 """ exception raised when bulk save contain errors. 38 error are saved in `errors` property. 39 """
40 - def __init__(self, errors, results, *args):
41 self.errors = errors 42 self.results = results
43
44 -class ViewServerError(Exception):
45 """ exception raised by view server"""
46
47 -class MacroError(Exception):
48 """ exception raised when macro parsiing error in functions """
49
50 -class DesignerError(Exception):
51 """ unkown exception raised by the designer """
52
53 -class ResourceNotFound(ResourceError):
54 """ Exception raised when resource is not found"""
55
56 -class ResourceConflict(ResourceError):
57 """ Exception raised when there is conflict while updating"""
58
59 -class PreconditionFailed(ResourceError):
60 """ Exception raised when 412 HTTP error is received in response 61 to a request """
62