WEEE-Open / pytarallo

Python T.A.R.A.L.L.O. API
MIT License
2 stars 4 forks source link

Create a custom ItemNotFoundError exception class #19

Closed steemnd closed 6 years ago

steemnd commented 6 years ago

Must be raised here:

https://github.com/WEEE-Open/python-tarallo/blob/aac1f5b70ca896e613a6b20632a53cd2ec40dd8f/tarallo.py#L45

18

lvps commented 6 years ago

In a "move" operation both the item and its parent could be non existing. The server returns the same code (404 IIRC) but with a different message and possibly a different machine-readable code in the response.

What do we do on the client? Do we use this exception for both or create 1 more or 2 more exceptions?

steemnd commented 6 years ago

Then let's create another LocationNotFoundError exception

lvps commented 6 years ago

Sounds good, we can use it for new items when their location doesn't exist, too