I'm using a pre put hook to fetch some data from an api before each put. If that api does not respond, or is offline, I want the request to fail. Do I have to write a wrapper around a put() call, or is there some way so that we can still type My_model.put() and just make it fail?
_pre_put_hook is called immediately before NDB does the actual put... so if an exception is raised inside of _pre_put_hook, then the entire put will fail
Can I cause a put to fail from the _pre_put_hook?