B2G/gecko/services/aitc/modules/client.js
/**
   * PUT from _putApp finished, process.
   */
PUT from _putApp finished, process.
PUT from _putApp finished process .
function _processPutApp(error, cb, req) {
    this._setBackoff(req);
    if (error) {
      this._log.error("_putApp request error " + error);
      cb(error, null);
      return;
    }
    let err = null;
    switch (req.response.status) {
      case 201:
      case 204:
        this._log.info("_putApp succeeded");
        cb(null, true);
        break;
      case 401:
        err = new Error("_putApp failed due to 401 authentication failure");
        this._log.warn(err);
        err.authfailure = true;
        cb(err, null);
        break;
      case 409:
        err = new Error("_putApp failed due to 409 conflict");
        this._log.warn(err);
        cb(err,null);
        break;
      case 400:
      case 412:
      case 413:
        let msg = "_putApp returned: " + req.response.status;
        this._log.warn(msg);
        err = new Error(msg);
        err.processed = true;
        cb(err, null);
        break;
      default:
        this._error(req);
        err = new Error("Unexpected error with _putApp");
        err.processed = false;
        cb(err, null);
        break;
    }
  }
function _processPutApp ( error , cb , req ) { this . _setBackoff ( req ) ; if ( error ) { this . _log . error ( "_putApp request error " + error ) ; cb ( error , null ) ; return ; } let err = null ; switch ( req . response . status ) { case 201 : case 204 : this . _log . info ( "_putApp succeeded" ) ; cb ( null , true ) ; break ; case 401 : err = new Error ( "_putApp failed due to 401 authentication failure" ) ; this . _log . warn ( err ) ; err . authfailure = true ; cb ( err , null ) ; break ; case 409 : err = new Error ( "_putApp failed due to 409 conflict" ) ; this . _log . warn ( err ) ; cb ( err , null ) ; break ; case 400 : case 412 : case 413 : let msg = "_putApp returned: " + req . response . status ; this . _log . warn ( msg ) ; err = new Error ( msg ) ; err . processed = true ; cb ( err , null ) ; break ; default : this . _error ( req ) ; err = new Error ( "Unexpected error with _putApp" ) ; err . processed = false ; cb ( err , null ) ; break ; } }
PUT from _putApp finished, process.
PUT from _putApp finished process .
// Bubble auth failure back up so new token can be acquired. // Retry on server conflict.