Runner exception handling patch

13 views
Skip to first unread message

Kim Gräsman

unread,
Oct 10, 2011, 3:02:35 PM10/10/11
to igloo-...@googlegroups.com
Hello,

I'm using Igloo for a side project, and it occurred to me that there's
no exception handler for the spec execution, so the entire runner
terminates if a spec throws an unexpected exception.

Have we decided explicitly that we like that behavior (for ease of
debugging, for example)?

I noticed it really bugged me in my current context, so I hacked up a
patch to catch all std::exceptions and report them with existing
mechanisms. Feel free to adopt if it's generally useful.

I keep thinking that it would be nice to be able to register custom
exception types to handle, but I can't be bothered at the moment...

- Kim

0001-Added-handling-of-std-exception-to-context-registry-.patch

Joakim Karlsson

unread,
Oct 21, 2011, 1:32:35 PM10/21/11
to igloo-...@googlegroups.com
Hi Kim,

Sorry for not replying sooner.

I'll take a look at your patch. I think we semi-automatically assumed
unknown exceptions shouldn't be caught.

How is it bugging you in your current context?

/Joakim

Kim Gräsman

unread,
Oct 21, 2011, 2:24:40 PM10/21/11
to igloo-...@googlegroups.com
Hi there,

IIRC, the default behavior on Windows was that std::unexpected was called, and I got a less-than-helpful "The program has requested that the runtime terminate in an unusual manner." message box.

It's weird, though, now that I think about it... std::unexpected/terminate/abort should only be called when a new exception is thrown as part of stack unwinding or if a function violates its exception spec. But I don't think either happens in this case. Maybe I should investigate closer...

- Kim
Reply all
Reply to author
Forward
0 new messages