OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/test/webdriver/webdriver_error.h" | 5 #include "chrome/test/webdriver/webdriver_error.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 namespace webdriver { | 9 namespace webdriver { |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 Error::~Error() { | 56 Error::~Error() { |
57 } | 57 } |
58 | 58 |
59 void Error::AddDetails(const std::string& details) { | 59 void Error::AddDetails(const std::string& details) { |
60 if (details_.empty()) | 60 if (details_.empty()) |
61 details_ = details; | 61 details_ = details; |
62 else | 62 else |
63 details_ = details + ";\n " + details_; | 63 details_ = details + ";\n " + details_; |
64 } | 64 } |
65 | 65 |
66 std::string Error::GetMessage() const { | 66 std::string Error::GetErrorMessage() const { |
67 std::string msg; | 67 std::string msg; |
68 if (details_.length()) | 68 if (details_.length()) |
69 msg = details_; | 69 msg = details_; |
70 else | 70 else |
71 msg = DefaultMessageForErrorCode(code_); | 71 msg = DefaultMessageForErrorCode(code_); |
72 | 72 |
73 // Only include a stacktrace on Linux. Windows and Mac have all symbols | 73 // Only include a stacktrace on Linux. Windows and Mac have all symbols |
74 // stripped in release builds. | 74 // stripped in release builds. |
75 #if defined(OS_LINUX) | 75 #if defined(OS_LINUX) |
76 size_t count = 0; | 76 size_t count = 0; |
(...skipping 14 matching lines...) Expand all Loading... |
91 | 91 |
92 const std::string& Error::details() const { | 92 const std::string& Error::details() const { |
93 return details_; | 93 return details_; |
94 } | 94 } |
95 | 95 |
96 const base::debug::StackTrace& Error::trace() const { | 96 const base::debug::StackTrace& Error::trace() const { |
97 return trace_; | 97 return trace_; |
98 } | 98 } |
99 | 99 |
100 } // namespace webdriver | 100 } // namespace webdriver |
OLD | NEW |