зеркало из https://github.com/mozilla/gecko-dev.git
webdriver: error: rename WebDriverError.status_code to error_code
The WebDriver standard uses the term "JSON error code" and "error code" to refer to the string identifier of the error type. We should follow suit. Source-Repo: https://github.com/mozilla/webdriver-rust Source-Revision: fd03b53eb29dd4dea37f41648196c7888905693f --HG-- extra : subtree_source : http%3A//tristan.corp.lon2.mozilla.com%3A8000 extra : subtree_revision : 0873788dc46ddbd3cd54c47961cb2116c0379506
This commit is contained in:
Родитель
bf272f948c
Коммит
5184739f1b
|
@ -140,8 +140,8 @@ impl WebDriverError {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn status_code(&self) -> &'static str {
|
||||
self.error.status_code()
|
||||
pub fn error_code(&self) -> &'static str {
|
||||
self.error.error_code()
|
||||
}
|
||||
|
||||
pub fn http_status(&self) -> StatusCode {
|
||||
|
@ -156,7 +156,7 @@ impl WebDriverError {
|
|||
impl ToJson for WebDriverError {
|
||||
fn to_json(&self) -> Json {
|
||||
let mut data = BTreeMap::new();
|
||||
data.insert("error".into(), self.status_code().to_json());
|
||||
data.insert("error".into(), self.error_code().to_json());
|
||||
data.insert("message".into(), self.message.to_json());
|
||||
data.insert("stacktrace".into(),
|
||||
format!("{:?}", self.backtrace).to_json());
|
||||
|
@ -168,7 +168,7 @@ impl ToJson for WebDriverError {
|
|||
|
||||
impl Error for WebDriverError {
|
||||
fn description(&self) -> &str {
|
||||
self.status_code()
|
||||
self.error_code()
|
||||
}
|
||||
|
||||
fn cause(&self) -> Option<&Error> {
|
||||
|
|
Загрузка…
Ссылка в новой задаче