more reliable detection of decoding errors, allow specifying of export result code (see previous commit; still unsure whether this should be NOT_PROCESSED or SUCCESS, I think NOT_PROCESSED is better, but it uses SUCCESS at the moment). refs #661