On Tue, Jun 6, 2017 at 12:19 AM, Johannes Zeppenfeld <[email protected]>
wrote:

> Yeah, I understand that completely... Is there some way to indicate an
> error other than throwing an exception? What I would consider dangerous
> here is not that the behavior is undefined, but that debug mode throws an
> exception (which is reasonable and lets people (or at least me :) think
> they can catch it) but release mode silently does something else instead. I
> would expect debug mode to fail noisily (e.g., terminate) for anything that
> is undefined in release mode.
>

KJ exceptions are supposed to be treated as "noisy". As a rule I always
prefer throwing an exception over aborting, but I design my code such that
the error message is never lost.

Technically the opt-mode behavior is not "undefined". You may get a garbage
value, or an invalid pointer exception, but the code will never segfault or
anything like that.

-Kenton

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/capnproto.

Reply via email to