mrb: handle error case