New error-handling support: jb_err type and JB_ERR_xxx constants