Example #1
0
const VerifyConnectionResponse = function (xhr, etag) {
  if (xhr.status === 422) {
    const authConfig = AuthConfigs.AuthConfig.fromJSON(xhr.responseJSON.auth_config);
    authConfig.etag(etag);

    return {
      authConfig,
      errorMessage: xhr.responseJSON.message,
      status:       xhr.responseJSON.status
    };
  } else {
    return {errorMessage: mrequest.unwrapErrorExtractMessage(xhr.responseJSON, xhr)};
  }
};
Example #2
0
File: agents.js Project: cv/gocd
const reject = (deferred) => (jqXHR, _textStatus, _errorThrown) => {
  deferred.reject(mrequest.unwrapErrorExtractMessage(jqXHR.responseJSON, jqXHR));
};
Example #3
0
 const didReject = (jqXHR) => {
   deferred.reject(mrequest.unwrapErrorExtractMessage(jqXHR.responseJSON, jqXHR));
 };
Example #4
0
 const didReject = ({responseJSON}, _textStatus, _errorThrown) => {
   deferred.reject(mrequest.unwrapErrorExtractMessage(responseJSON));
 };