adapted main.cpp to rj::error_handler