The topmost function can raise std::bad_function_call exception.
Due to the ease of exception handling, the main function handles the exception.
This patch fixes a coverity issue (issue number:
1841863).
Change-Id: If70beacd705adea1d3300b02632b025bc00ae30d
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <functional>
#include <memory>
#include <set>
signal(SIGINT, on_exit);
signal(SIGTERM, on_exit);
- prog->RunAndPrintJson(out_stream);
+ try {
+ prog->RunAndPrintJson(out_stream);
+ } catch (std::bad_function_call &e) {
+ fprintf(stderr, "Exception: %s\n", e.what());
+ }
fclose(out_stream);
if (dump_to_file)