Skip to content

Commit

Permalink
move 'NoError' check to more appropriate position
Browse files Browse the repository at this point in the history
  • Loading branch information
donsuhr committed Feb 9, 2015
1 parent 7e88bfa commit 13a81b6
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sputils/doesMsgHaveError.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ define(["jquery"], function($){
spErrCode = $msg.find("ErrorCode"),
response = false;

if ( !spErrCode.length || spErrCode.text() === "NoError") {
if ( !spErrCode.length ) {

if ( $msg.find("faultcode").length ) {

Expand All @@ -27,8 +27,8 @@ define(["jquery"], function($){
}

spErrCode.each(function(){

if ( $(this).text() !== "0x00000000" ) {
if ( $(this).text() !== "0x00000000" && $(this).text() !== "NoError" ) {

response = true;
return false;
Expand Down
13 changes: 13 additions & 0 deletions test/server/login.operation.response.cannotBeNull.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Server was unable to process request. ---&gt; Value cannot be null.
Parameter name: userName
</faultstring>
<detail/>
</soap:Fault>
</soap:Body>
</soap:Envelope>
13 changes: 13 additions & 0 deletions test/server/login.operation.response.noError.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<LoginResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<LoginResult>
<CookieName>FedAuth</CookieName>
<ErrorCode>NoError</ErrorCode>
<TimeoutSeconds>1800</TimeoutSeconds>
</LoginResult>
</LoginResponse>
</soap:Body>
</soap:Envelope>
12 changes: 12 additions & 0 deletions test/server/login.operation.response.passwordNotMatch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<LoginResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<LoginResult>
<ErrorCode>PasswordNotMatch</ErrorCode>
<TimeoutSeconds>0</TimeoutSeconds>
</LoginResult>
</LoginResponse>
</soap:Body>
</soap:Envelope>

0 comments on commit 13a81b6

Please sign in to comment.