前提・実現したいこと
例外のcatch処理に警告が出ました。
発生している問題・エラーメッセージ
warning: exception of type 'boost::system::system_error' will be caught catch(boost::system::system_error& e) warning: by earlier handler for 'std::exception' catch(std::exception& e)
該当のソースコード
C++
1#include <exception> 2#include <boost/system/system_error.hpp> 3#include <boost/system/error_code.hpp> 4 5try 6{ 7 … 8} 9catch(std::exception& e) 10{ 11 cerr << "standard c++ library exception was occured.\n"; 12 cerr << "error message: " << e.what() << '\n'; 13 return 1; 14} 15catch(boost::system::system_error& e) 16{ 17 cerr << "boost exception was occured.\n"; 18 cerr << "error code:\t" << e.code().value() << '\n'; 19 cerr << "error message:\t" << e.what() << '\n'; 20 return 1; 21} 22catch(...) 23{ 24 cerr << "error.\n"; 25 return 1; 26}
どうすれば、この警告は出なくなるのでしょうか。
どうか、よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/01/27 08:19