Index: chrome/test/chromedriver/status.cc |
diff --git a/chrome/test/chromedriver/status.cc b/chrome/test/chromedriver/status.cc |
index bd5027952730113170b963a3c136c717b6770c5a..89dc7e9184885f08555e997268f0885ea21ee557 100644 |
--- a/chrome/test/chromedriver/status.cc |
+++ b/chrome/test/chromedriver/status.cc |
@@ -19,6 +19,8 @@ const char* DefaultMessageForStatusCode(StatusCode code) { |
return "session not created exception"; |
case kNoSuchSession: |
return "no such session"; |
+ case kChromeNotReachable: |
+ return "chrome not reachable"; |
default: |
return "<unknown>"; |
} |
@@ -34,6 +36,21 @@ Status::Status(StatusCode code, const std::string& details) |
msg_(DefaultMessageForStatusCode(code) + std::string(": ") + details) { |
} |
+Status::Status(StatusCode code, const Status& cause) |
+ : code_(code), |
+ msg_(DefaultMessageForStatusCode(code) + std::string("\nfrom ") + |
+ cause.message()) {} |
+ |
+Status::Status(StatusCode code, |
+ const std::string& details, |
+ const Status& cause) |
+ : code_(code), |
+ msg_(DefaultMessageForStatusCode(code) + std::string(": ") + details + |
+ "\nfrom " + cause.message()) { |
+} |
+ |
+Status::~Status() {} |
+ |
bool Status::IsOk() const { |
return code_ == kOk; |
} |