Hrm.  I'm not quite certain if there's anything we could really do for that kind of invariant this deep, aside from doing what you're doing and not crashing.  I suppose you could keep an integer counter of the number of errors encountered and return it to the Erlang side, then log something hand-wavy if the return is non-zero?