Skip to content

Commit

Permalink
Add an exception describing the case when an object is missing an att…
Browse files Browse the repository at this point in the history
…ribute.

Signed-off-by: MICHELE GAZZETTI <[email protected]>
  • Loading branch information
mgazz committed Feb 2, 2024
1 parent 2d13c17 commit 998796a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions sunfish/lib/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ def __init__(self, resource_id):
self.message = message
super().__init__(self.message)


class PropertyNotFound(BaseException):
"""
Exception raised when the resource is not found.
Attributes:
attribute_name -- name of the attribute not found
message -- explanation of the error
+ """

def __init__(self, attribute_name):
self.attribute_name=attribute_name
message = "Attribute " + attribute_name+ " not found."
self.message = message
super().__init__(self.message)


class CollectionNotSupported(BaseException):
"""
Exception raised when the payload is not valid
Expand Down

0 comments on commit 998796a

Please sign in to comment.