1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:47:46 +00:00

WebDriver: Use WebDriverError::from_code() for all error creation

This commit is contained in:
Sam Atkins 2022-10-20 14:00:49 +01:00 committed by Linus Groh
parent 9393904073
commit 3232622255
4 changed files with 86 additions and 87 deletions

View file

@ -84,7 +84,7 @@ private:
Variant<WebDriverError, Error> error = result.release_error();
if (error.has<WebDriverError>())
return error.get<WebDriverError>();
return WebDriverError { 500, "unsupported operation", error.get<Error>().string_literal() };
return WebDriverError::from_code(ErrorCode::UnsupportedOperation, error.get<Error>().string_literal());
}
return result.release_value();
@ -95,7 +95,7 @@ private:
Variant<WebDriverError, Error> error = result.release_error();
if (error.has<WebDriverError>())
return error.get<WebDriverError>();
return WebDriverError { 500, "unsupported operation", error.get<Error>().string_literal() };
return WebDriverError::from_code(ErrorCode::UnsupportedOperation, error.get<Error>().string_literal());
}
return {};
}