From 7e88bfaf8c3d7f0a1e2d317163e9558d5bacf88b Mon Sep 17 00:00:00 2001
From: Bill <bill@donsuhr.com>
Date: Sun, 8 Feb 2015 11:45:14 -0800
Subject: [PATCH 1/2] check for error code of 'NoError'

---
 src/sputils/doesMsgHaveError.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sputils/doesMsgHaveError.js b/src/sputils/doesMsgHaveError.js
index 02f2b5c..fea01f8 100644
--- a/src/sputils/doesMsgHaveError.js
+++ b/src/sputils/doesMsgHaveError.js
@@ -14,7 +14,7 @@ define(["jquery"], function($){
             spErrCode   = $msg.find("ErrorCode"),
             response    = false;
 
-        if ( !spErrCode.length ) {
+        if ( !spErrCode.length || spErrCode.text() === "NoError") {
 
             if ( $msg.find("faultcode").length ) {
 

From 13a81b6cc7aef2292395c0f3bc76cfbfb73d5e30 Mon Sep 17 00:00:00 2001
From: Bill <bill@donsuhr.com>
Date: Mon, 9 Feb 2015 08:29:09 -0800
Subject: [PATCH 2/2] move 'NoError' check to more appropriate position

---
 src/sputils/doesMsgHaveError.js                     |  6 +++---
 .../login.operation.response.cannotBeNull.xml       | 13 +++++++++++++
 test/server/login.operation.response.noError.xml    | 13 +++++++++++++
 .../login.operation.response.passwordNotMatch.xml   | 12 ++++++++++++
 4 files changed, 41 insertions(+), 3 deletions(-)
 create mode 100644 test/server/login.operation.response.cannotBeNull.xml
 create mode 100644 test/server/login.operation.response.noError.xml
 create mode 100644 test/server/login.operation.response.passwordNotMatch.xml

diff --git a/src/sputils/doesMsgHaveError.js b/src/sputils/doesMsgHaveError.js
index fea01f8..6223d8c 100644
--- a/src/sputils/doesMsgHaveError.js
+++ b/src/sputils/doesMsgHaveError.js
@@ -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 ) {
 
@@ -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;
diff --git a/test/server/login.operation.response.cannotBeNull.xml b/test/server/login.operation.response.cannotBeNull.xml
new file mode 100644
index 0000000..495c4eb
--- /dev/null
+++ b/test/server/login.operation.response.cannotBeNull.xml
@@ -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>
diff --git a/test/server/login.operation.response.noError.xml b/test/server/login.operation.response.noError.xml
new file mode 100644
index 0000000..84293ee
--- /dev/null
+++ b/test/server/login.operation.response.noError.xml
@@ -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>
diff --git a/test/server/login.operation.response.passwordNotMatch.xml b/test/server/login.operation.response.passwordNotMatch.xml
new file mode 100644
index 0000000..489f519
--- /dev/null
+++ b/test/server/login.operation.response.passwordNotMatch.xml
@@ -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>