| Previous | Next |
| STG_E_REVERTED | STG_E_OLDFORMAT |
STG_E_CANTSAVE
Do not treat it as a cosmetic failure
STG_E_CANTSAVE means the save operation could not be completed. It is intentionally less specific than STG_E_MEDIUMFULL, STG_E_WRITEFAULT, or STG_E_ACCESSDENIED; the useful next step is to preserve the more detailed context from the operation that led to it. In a compound-file workflow, the error can be surfaced during a final commit after several streams or nested storages were changed.
The crucial operational rule is that in-memory changes are not proof of durable storage. A root IStorage should be committed explicitly and the HRESULT checked. Releasing the object may flush buffers, but it cannot provide a reliable error result to the caller.
How to make save failures actionable
- Record the complete HRESULT chain, path, storage mode, temporary location, and available space at the time of the failure.
- Save user work to a new location or durable recovery file before attempting repair or overwrite.
- Check destination permissions, share availability, capacity, and simultaneous access before changing application logic.
- Design save as a recoverable operation: retain the prior good version until commit succeeds and validate the resulting document if the format is business-critical.
References
Looking for a different code? Search another status or error code.