Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
static void my_assertion_proc(const char* message)
{
    printf("It's OK. I caught the assertion: %s\n", message);
    // Do something like throw MyProj::FatalException(message);
}

int main(int argc, char **argv)
{
    codes_set_codes_assertion_failed_proc(&my_assertion_proc);

    // All asserts in the ecCodes library will now be caught
    ...

    // Now restore default behaviour
    codes_set_codes_assertion_failed_proc(NULL);

    return 0;
}

...

Content by Label
showLabelsfalse
max5
spacesUDOC
showSpacefalse
sortmodified
reversetrue
typepage
excludeCurrenttrue
cqllabel in ("eccodes-faqs","kb-how-to-article") and label in ("assert","programming","bufr","grib") and type = "page" and space = "UDOC"
labelskb-how-to-article eccodes-faqs

...