Keep in mind, as Marcus suggested, keeping a separation between your saves and your tools means if anything goes wrong, at all, your users won’t be left without a saved file. Idiot proofing your code is not about you not having confidence in your tool, there are some geniuses out there who really don’t consider anything beyond their own desk when it comes to deployment.
For example, something as seemingly simple as adding a print statement into that call-back without explicitly stating the pipe buffer you want to print to (print >> sys.stderr,’oops’) can come back and bite your tool very hard when the IT heads decide once day to alter the pipes so their shell navigation tools work better.
Hard to fathom but I’ve literally seen a UNIX setup that’s capable of breaking the direction of the pipe buffer causing massive errors on prints in Maya (that’s why and when I had to learn the >> method of printing so people could save their files during the week that was fixed)
To be failsafe and relatively idiot-guarded:
-First do a local save with nothing other than Maya’s internal workings.
-Then do whatever metadata manipulation, notifications or logging you need to do.
-Then distribute your files.
-Give a second notification to a support personnel if the distribution didn’t deliver.
It is more steps, but if what you are building then becomes the next super-tool in the world of saving/loading and general scene access you’ll be thankful to not have to account for why dozens of artists on a deadline are not able to deliver their work.
Hope this helps