yes, we have similar problem in cheetah gem. One of possible solutions is to use optional map with allowed exit codes, that is by default only 0 ( but calling such API is not nice in C++, in ruby it looks much better). But it is just idea.