You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was working with the project when I encountered an issue with my inputs that manifested itself as an uncaught URLNotFoundNomadException. It took me a while to figure out that this did not actually refer to an invalid URL being used but rather is a blanket exception for almost anything that can go wrong with a request to Nomad as I eventually saw from here on lines 121-122:
I think it is rather confusing to use this exception for responses that have anything other than a 404 status code. Would it not be more appropriate to use the BaseNomadException class for the general case of something going wrong?
The text was updated successfully, but these errors were encountered:
Hey @jeteon, sorry for the confusion ( I do agree it is confusing ). We could add BaseNomadException as the parent class/inherited class for UrlNotFoundNomadException so you would be able to just handle that. I should have done that from the get go. There are some cases for example if you were to look up a job that doesn't exist Nomad would return a 404 status code back raising UrlNotFoundNomadException. Let me know what you think about the inheritance it should be a non-breaking change.
The inheritance should be non-breaking and would work yes. I guess I was coming from the perspective of discovering the library interactively so the displayed exception is what matters and not so much what I would be trying to catch in code. Perhaps if there was a child of UrlNotFoundNomadException then existing implementations could continue to catch that but a more semantically correct exception would be raised and used in future implementations.
I was working with the project when I encountered an issue with my inputs that manifested itself as an uncaught
URLNotFoundNomadException
. It took me a while to figure out that this did not actually refer to an invalid URL being used but rather is a blanket exception for almost anything that can go wrong with a request to Nomad as I eventually saw from here on lines 121-122:python-nomad/nomad/api/base.py
Lines 100 to 125 in 90e94ba
I think it is rather confusing to use this exception for responses that have anything other than a 404 status code. Would it not be more appropriate to use the
BaseNomadException
class for the general case of something going wrong?The text was updated successfully, but these errors were encountered: