Bug 1396831 - Align HTTP status codes with specification. r?jgraham draft
authorAndreas Tolfsen <ato@sny.no>
Tue, 05 Sep 2017 14:42:12 +0100
changeset 659088 915e5c6625c9812c0c00e916f867d6c93b9ef590
parent 659087 505f8c047c73864322aabc64ed938037cc1e42e3
child 729876 4aa8e806ea4a5f852f05dcad49e7bdfcb3cbc054
push id78006
push userbmo:ato@sny.no
push dateTue, 05 Sep 2017 13:43:13 +0000
reviewersjgraham
bugs1396831
milestone57.0a1
Bug 1396831 - Align HTTP status codes with specification. r?jgraham Some of the HTTP status codes have changed in the WebDriver specification, as shown in: https://github.com/w3c/webdriver/commit/d678562e3d5f94fa71d74aeb467214bf8dd734e1 MozReview-Commit-ID: 4DLkYDXckew
testing/webdriver/src/error.rs
--- a/testing/webdriver/src/error.rs
+++ b/testing/webdriver/src/error.rs
@@ -189,29 +189,29 @@ impl ErrorStatus {
             InvalidArgument => BadRequest,
             InvalidCookieDomain => BadRequest,
             InvalidCoordinates => BadRequest,
             InvalidElementState => BadRequest,
             InvalidSelector => BadRequest,
             InvalidSessionId => NotFound,
             JavascriptError => InternalServerError,
             MoveTargetOutOfBounds => InternalServerError,
-            NoSuchAlert => BadRequest,
+            NoSuchAlert => NotFound,
             NoSuchCookie => NotFound,
             NoSuchElement => NotFound,
-            NoSuchFrame => BadRequest,
-            NoSuchWindow => BadRequest,
+            NoSuchFrame => NotFound,
+            NoSuchWindow => NotFound,
             ScriptTimeout => RequestTimeout,
             SessionNotCreated => InternalServerError,
             StaleElementReference => BadRequest,
             Timeout => RequestTimeout,
             UnableToCaptureScreen => BadRequest,
             UnableToSetCookie => InternalServerError,
             UnexpectedAlertOpen => InternalServerError,
-            UnknownCommand => NotFound,
+            UnknownCommand => NotImplemented,
             UnknownError => InternalServerError,
             UnknownMethod => MethodNotAllowed,
             UnknownPath => NotFound,
             UnsupportedOperation => InternalServerError,
         }
     }
 }