Skip to content

int: Add some more debugging help for OCIO exceptions#5190

Merged
lgritz merged 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-colorexceptions
May 12, 2026
Merged

int: Add some more debugging help for OCIO exceptions#5190
lgritz merged 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-colorexceptions

Conversation

@lgritz
Copy link
Copy Markdown
Collaborator

@lgritz lgritz commented May 9, 2026

In PR #5164, we changed to not be quite as aggressive in treating OCIO exceptions as real errors. All still good with that, but sometimes it is helpful to know exactly what OCIO wants to tell us, for debugging.

In this PR, we allow our color debug mode (triggered when environment variable OIIO_DEBUG_COLOR is set to nonzero) to print debugging messages that reveal the exception messages. It's a debugging aid for developers, no users will want this. In ordinary operations, we really do want to just ignore those exceptions. But if something is misbehaving and we don't know why, it may be helpful to know which of the exceptions is being caught and what the message was.

@lgritz lgritz force-pushed the lg-colorexceptions branch from 818c71b to b3908ac Compare May 10, 2026 06:23
In PR 5164, we changed to not be quite as aggressive in treating OCIO
exceptions as real errors. All still good with that, but sometimes it
is helpful to know exactly what OCIO wants to tell us, for debugging.

In this PR, we allow our color debug mode (triggered when environment
variable OIIO_DEBUG_COLOR is set to nonzero) to print debugging
messages that reveal the exception messages. It's a debugging aid for
developers, no users will want this. In ordinary operations, we really
do want to just ignore those exceptions. But if something is
misbehaving and we don't know why, it may be helpful to know which of
the exceptions is being caught and what the message was.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
@lgritz lgritz force-pushed the lg-colorexceptions branch from b3908ac to 1fb601a Compare May 10, 2026 06:27
@lgritz lgritz requested a review from zachlewis May 10, 2026 06:32
@lgritz
Copy link
Copy Markdown
Collaborator Author

lgritz commented May 12, 2026

@zachlewis This look ok to you?

Copy link
Copy Markdown
Collaborator

@zachlewis zachlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a great idea! As you say, OCIO raises a lot of exceptions... I was wondering how to gracefully handle this with OIIO, and of course this is the most intuitive way. Nicely done. LGTM.

@lgritz lgritz merged commit 6e42dfb into AcademySoftwareFoundation:main May 12, 2026
55 of 56 checks passed
@lgritz lgritz deleted the lg-colorexceptions branch May 13, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants