MCPcopy Create free account
hub / github.com/ImageEngine/cortex / ThrowingMessageHandler

Class ThrowingMessageHandler

test/IECore/MessageHandler.py:237–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235 # this is the most convenient place to put the test right now.
236
237 class ThrowingMessageHandler( IECore.MessageHandler ):
238
239 def __init__( self ) :
240
241 IECore.MessageHandler.__init__( self )
242
243 def handle( self, level, context, msg ):
244
245 if context == "python" :
246 raise Exception( "Test" )
247 else :
248 assert( context == "c++" )
249 # This will raise a C++ exception that gets translated to a
250 # Python exception, and then gets translated back to a C++
251 # exception by the MessageHandlerWrapper, before finally
252 # being converted back to another Python exception by the
253 # binding for `IECore.msg()`.
254 IECore.StringAlgo.substitute( "##", { "frame" : IECore.BoolData( False ) } )
255
256 for exceptionType in [ "python", "c++" ] :
257

Callers 1

testExceptionHandlingMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected