void THROW(Class *klass, char *pattern, ...) { va_list args; va_start(args, pattern); String *message = S_str_vnewf(pattern, args); va_end(args); Err *err = (Err*)Class_Make_Obj(klass); err = Err_init(err, message); Err_do_throw(err); }
void Err_throw_at(Class *klass, const char *file, int line, const char *func, const char *pattern, ...) { va_list args; va_start(args, pattern); String *message = S_vmake_mess(file, line, func, pattern, args); va_end(args); Err *err = (Err*)Class_Make_Obj(klass); err = Err_init(err, message); Err_do_throw(err); }
void THROW(VTable *vtable, char *pattern, ...) { va_list args; Err_Make_t make = METHOD_PTR(CERTIFY(vtable, VTABLE), Lucy_Err_Make); Err *err = (Err*)CERTIFY(make(NULL), ERR); CharBuf *mess = Err_Get_Mess(err); va_start(args, pattern); CB_VCatF(mess, pattern, args); va_end(args); Err_do_throw(err); }
void Err_throw_at(VTable *vtable, const char *file, int line, const char *func, const char *pattern, ...) { va_list args; Err_Make_t make = METHOD_PTR(CERTIFY(vtable, VTABLE), Lucy_Err_Make); Err *err = (Err*)CERTIFY(make(NULL), ERR); CharBuf *mess = Err_Get_Mess(err); va_start(args, pattern); S_vcat_mess(mess, file, line, func, pattern, args); va_end(args); Err_do_throw(err); }
void Err_rethrow(Err *self, const char *file, int line, const char *func) { Err_Add_Frame_IMP(self, file, line, func); Err_do_throw(self); }
void Err_throw_mess(Class *klass, String *message) { UNUSED_VAR(klass); Err *err = Err_new(message); Err_do_throw(err); }
void Err_rethrow(Err *self, const char *file, int line, const char *func) { Err_add_frame(self, file, line, func); Err_do_throw(self); }