コード例 #1
0
void workflow::report_exception(const std::exception& e) const {
    /*
     * We must catch by std::exception and cast the boost exception
     * here; if we were to catch boost exception, we would not have
     * access to the what() method and thus could not provide a
     * user-friendly message to the console.
     */
    const auto be(dynamic_cast<const boost::exception* const>(&e));
    if (be && can_log_) {
        BOOST_LOG_SEV(lg, error) << "Error: "
                                 << boost::diagnostic_information(*be);
    }

    std::cerr << "Error: " << e.what() << std::endl;
    report_exception_common();
}
コード例 #2
0
void workflow::report_exception(const std::exception& e) const {
    /* we must catch by std::exception and cast the boost
     * exception here; if we were to catch boost exception, we
     * would not have access to the what() method and thus could
     * not provide a user-friendly message to the console.
     */
    const auto be(dynamic_cast<const boost::exception* const>(&e));
    if (be && can_log_) {
        BOOST_LOG_SEV(lg, error) << "Error: "
                                 << boost::diagnostic_information(*be);
    }

    if (be) {
        const auto file_name(boost::get_error_info<stitch::error_in_file>(e));
        if (file_name)
            std::cerr << *file_name;

        const auto line_number(boost::get_error_info<stitch::error_at_line>(e));
        if (line_number)
            std::cerr << ":" << *line_number << ": error: ";
    }
    std::cerr << e.what() << std::endl;
    report_exception_common();
}
コード例 #3
0
void workflow::report_exception() const {
    std::cerr << "Stitcher was forced to terminate." << std::endl;
    report_exception_common();
}