-
Notifications
You must be signed in to change notification settings - Fork 603
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: print unretrieved global error messages (#4005)
In the ongoing effort to help newcomers to OIIO diagnose their own problems, this uses a trick to print any global error messages that never got retrieved by OIIO::geterror() at the time that the program exits. (This is all similar to a change we made recently that adds an analogous behavior to ImageBuf, but in this case it's for those error messages that don't have an object like an ImageBuf to attach to.) This should have no effect on anybody who diligently checks OIIO::has_error() or OIIO::geterror() after any failed calls that would send error messages to that global store. Also, it is possible to disable the behavior by setting the new global attribute "oiio:print_uncaught_errors" to 0. But for users who don't know to check errors and are experiencing baffling behavior with OIIO, maybe seing those error messages will prompt them to understand what's going wrong before they feel the need to file an issue against OIIO or need to ask us for help. Doing this helped me to find two places where our own code in OIIO failed to clear the global error at times that it should, and these are also fixed as part of this PR. Signed-off-by: Larry Gritz <[email protected]>
- Loading branch information
Showing
4 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters