예제 #1
0
파일: jdtest.c 프로젝트: AndyA/emitron
int main(void) {
  try {
    JD_2VARS(a, b);
    jd_set_string(a, "This is A");
    jd_throw("Oops: a=%J", a);
    jd_set_bool(b, 1);
  }
  puts("cleanup");
  catch (e) jd_rethrow(e);
예제 #2
0
파일: exception.c 프로젝트: nevali/jsondata
static void test_simple_throw(void) {
  try {
    JD_2VARS(a, b);
    jd_set_string(a, "This is A");
    jd_throw("Oops: a=%J", a);
    jd_set_bool(b, 1);
  }
  catch (e) {
    jdt_is_string(jd_rv(e, "$.message"),
                  "Oops: a=\"This is A\"",
                  "exception message matches");
    jd_release(e);
  }
}