๐จ Exception Handling
Don’t be scared of exceptions! They are just Python’s way of telling you that something went wrong.
ModelFailure
In Qaekwy, you might run into a ModelFailure
exception. This usually means you forgot to do something when you were building your model.
For example, if you forget to tell Qaekwy which searcher to use, it will raise a ModelFailure
exception.
from qaekwy.model.modeller import Modeller
from qaekwy.exception.model_failure import ModelFailure
modeller = Modeller()
try:
# I forgot to set a searcher!
modeller.to_json()
except ModelFailure as e:
print(f"Oops, I made a mistake! ๐
{e}")