23 #ifndef FrontSeatException20130221H 24 #define FrontSeatException20130221H 26 #include "goby/moos/protobuf/frontseat.pb.h" 32 : std::runtime_error(
"Unknown FrontSeatException"),
33 helm_err_(goby::moos::protobuf::ERROR_HELM_NONE), is_helm_error_(
false),
34 fs_err_(goby::moos::protobuf::ERROR_FRONTSEAT_NONE), is_fs_error_(
false)
39 : std::runtime_error(goby::moos::protobuf::HelmError_Name(err)), helm_err_(err),
40 is_helm_error_(
true), fs_err_(goby::moos::protobuf::ERROR_FRONTSEAT_NONE),
45 : std::runtime_error(goby::moos::protobuf::FrontSeatError_Name(err)),
46 helm_err_(goby::moos::protobuf::ERROR_HELM_NONE), is_helm_error_(
false), fs_err_(err),
52 goby::moos::protobuf::HelmError helm_err()
const {
return helm_err_; }
53 bool is_helm_error()
const {
return is_helm_error_; }
55 goby::moos::protobuf::FrontSeatError fs_err()
const {
return fs_err_; }
56 bool is_fs_error()
const {
return is_fs_error_; }
59 goby::moos::protobuf::HelmError helm_err_;
62 goby::moos::protobuf::FrontSeatError fs_err_;
68 if (e.is_helm_error())
69 os <<
"Error in the Helm: " << goby::moos::protobuf::HelmError_Name(e.helm_err());
70 else if (e.is_fs_error())
71 os <<
"Error in the Frontseat: " << goby::moos::protobuf::FrontSeatError_Name(e.fs_err());
73 os <<
"Unknown error.";