Skip to content

fix(int): OpenColorIO exception safety improvements - #5428

Open
lgritz wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-ocioexcept
Open

fix(int): OpenColorIO exception safety improvements#5428
lgritz wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-ocioexcept

Conversation

@lgritz

@lgritz lgritz commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

We had recently done a around to be sure that all OCIO calls were wrapped in try/catch (since OCIO uses exceptions, and we do not). But mostly we were catching OCIO::Exception and that was ok for an exception purposely thrown by OCIO, but what about an exception thrown by a system library call that OCIO called and failed to catch? It wouldn't be an OCIO::Exception, it would be a std::exception.

So catch those instead. OCIO::Exception derive from std::runtime_error, which derives from std::exception, so nothing will be missed because of this... but more things might get caught.

We had recently done a around to be sure that all OCIO calls were
wrapped in try/catch (since OCIO uses exceptions, and we do not).  But
mostly we were catching `OCIO::Exception` and that was ok for an
exception purposely thrown by OCIO, but what about an exception thrown
by a system library call that OCIO failed to catch? It wouldn't be an
OCIO::Exception, it would be a std::exception.

So catch those instead. OCIO::Exception derive from std::runtime_error,
which derives from std::exception, so nothing will be missed because of
this... but more things might get caught.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
@lgritz
lgritz requested review from chellmuth and zachlewis August 27, 2026 00:18
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.

1 participant