         message += msg.message + "\n"
     message        
 
-  @showCustomError: (jqXHR, callback) ->
-    LoggrUtil.log jqXHR
+  @showCustomError: (err, callback) ->
+    LoggrUtil.log "showCustomError " + JSON.stringify(err)
 
     # 400
-    if SFDC.isFieldCustomValidation(jqXHR)
+    if SFDC.isFieldCustomValidation(err)
       Dialog.alert L.get("error"), L.get("error_custom_validation_rule")
     # Expose 400 and 404 directly to the user.
-    else if jqXHR.status is 400 or jqXHR.status is 404
+    else if err.status is 400 or err.status is 404
       # json = {"readyState":4,"responseText":"[{\"message\":\"The requested resource does not exist\",\"errorCode\":\"NOT_FOUND\"}]","status":404,"statusText":"Not Found"}
-      LoggrUtil.log "Error: " + JSON.stringify(jqXHR)
-      message = SFDC.getMessageFromError jqXHR
-      Dialog.alert jqXHR.statusText, message
-    else if jqXHR.status is 403
-      if SFDC.isRestAPIDisabled(jqXHR)
+      LoggrUtil.log "Error: " + JSON.stringify(err)
+      message = SFDC.getMessageFromError err
+      Dialog.alert err.statusText, message
+    else if err.status is 403
+      if SFDC.isRestAPIDisabled(err)
         Dialog.alert L.get("error"), L.get("error_rest_api")
-      else if SFDC.isChatterAPIDisabled(jqXHR)
+      else if SFDC.isChatterAPIDisabled(err)
         LoggrUtil.log "Chatter API disabled."
         Config.chatterEnabled = false
-      else if SFDC.isRequestLimitExceeded(jqXHR)
+      else if SFDC.isRequestLimitExceeded(err)
         Dialog.alert L.get("error"), L.get("error_request_limit_exceeded")
-      else if SFDC.isForbidden(jqXHR)
+      else if SFDC.isForbidden(err)
         LoggrUtil.log "Forbidden"
-        callback jqXHR, null
+        callback err, null
     # 503
-    else if SFDC.isServiceUnavailable(jqXHR)
+    else if SFDC.isServiceUnavailable(err)
       Dialog.alert L.get("error"), L.get("error_service_unavailable")
     
     else
-      LoggrUtil.logError(JSON.stringify jqXHR)
+      LoggrUtil.logError(JSON.stringify err)
       
-    callback jqXHR, null
+    callback err, null
 
 if document? then $(document).on 'online', -> SFDC.replayQueue()
 window?.SFDC = SFDC

  # `accountIds` Array of account IDs  
  # `callback` Callback function (err, result)
  @getAccountNames: (accountIds, callback) ->
    soql = SFDC.getAccountNameQuery accountIds
    SFDC.query soql, callback


  # `accountId` Id of the account to find related contacts on  
  # `callback` Callback function (err, data)
  @getRelated: (relatedObject, accountId, callback) ->
    LoggrUtil.log "getRelated"
    soql = "SELECT Id, Name FROM #{relatedObject}
            WHERE Account.Id = '#{accountId}' ORDER BY Name"

