Avoid throwing exceptions from OffsetStreamPusher destructor.
ClosedPublic

Authored by stefanobonicatti on Jan 31 2016, 11:21 AM.

Details

Summary

Throwing exceptions from destructor was always a bad idea, but in C++11 would always call the program termination (so no stack unwinding and stuff).

Why a simple try catch with a message print?
I don't know the format it is writing into, but i kind of doubt that the error will be recoverable.
The question is, does it make sense to output something with broken parts? And if it does, what happens if we then try to seek to skip the failed write but the seek fails too?
I would expect that if the first write failed, every other operation on that file would fail (especially looking at what psdwrite does).

So this is here as a reminder of the little issue.

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
stefanobonicatti retitled this revision from to Avoid throwing exceptions from OffsetStreamPusher destructor..
stefanobonicatti updated this object.
stefanobonicatti edited the test plan for this revision. (Show Details)
stefanobonicatti added reviewers: dkazakov, rempt.
stefanobonicatti set the repository for this revision to R37 Krita.
stefanobonicatti added a project: Krita.
Restricted Application added a subscriber: woltherav. · View Herald TranscriptJan 31 2016, 11:21 AM
rempt accepted this revision.Feb 1 2016, 4:45 PM
rempt edited edge metadata.

Please push.

This revision is now accepted and ready to land.Feb 1 2016, 4:45 PM
This revision was automatically updated to reflect the committed changes.