设置图片配置，Api.getImagesSize函数回调
@param {Error} err 错误信息
@param {string|json} data 读取图片大小接口返回数据，包括图片大小和图片类型
@next this._setPos
517013
function(err, data){

    if (err) throw Error(data.toString());

    var baseDir = path.dirname(this.get('file'));
    var filePath;
    var imagesDef = this.imagesDef;

    forEach(data, function(def, file){
      filePath = path.relative(baseDir, file);
      filePath = filePath.replace(/\\+/g, '/');
      imagesDef[filePath] = def;
    });

    this._setPos();
  }
1000633
function(err, data) {
        var regexp = RegExp(/R(\d)(.*)/);
        var ret;
        var zoneName;

        if (data) {
            for (i = 0; i < data.length; i++) {
                if (ret = regexp.exec(data[i])) {
                    zoneName = data[i].trim().substr(2);
                    zones[zoneIds[parseInt(ret[1], 10)]] = zoneName;
                }
            }
        }
        callback(null, zones);                                                  // whatever happens, we finally go on
    }
566511
function onError(err) {
		// 请求（或响应）发生错误的时候，如果内部任何一层都未能捕获，则在最外层捕获
		Coralian.logger.err("HTTP req error : ");
		Coralian.logger.err(err.code);
		Coralian.logger.err(err.stack);

		// 如果发生 write after end ，则只将错误信息记录到 log 中去
		if (String.contains(err.message, 'write after end')) return;

		req.url = formatString(ERROR_ROUTE_FORMAT, (err.code || HttpStatusCode.INTERNAL_SERVER_ERROR));
		req.parse = url.parse(req.url, true);
		request(req, res);
	}
1346535
function jsonit(data, type, setType) {
    if ('string' !== typeof data) {
      throw new JsonItError('Invalid JsonIt type: ' + typeof data)
    }
    var result = {}
    if (data.length > 0) {
      try {
        var colonPos = data.indexOf(':')
        var commaPos = data.indexOf(',')
        if (colonPos < 0 || (commaPos >= 0 && commaPos < colonPos)) {
          if (setType) defaultType = setType
          type = type || defaultType
          data = type + ':' + data
        }
        result = jsonic(data)
      } catch(err) {
        throw new JsonItError(err.message)
      }
    }
    return result
  }
191382
function processData(err, data) {
              if (enc) { file.text = data.toString(enc); } else { file.buffer = data; }
              if (entry.sha) { file.sha = entry.sha; }
              append(err, file);
              readDone();
            }
907316
function errorPage(res, errMsg, publicMsg, useLayout) {
	if ( useLayout === undefined ) useLayout = true;
	console.log(errMsg);
	res.render('error', {
		layout: useLayout,
		errMsg: errMsg,
		publicMsg: publicMsg
	});			
}
258018
function errHandler(err) {
    process.stderr.write(chalk.red('Model generation failed!') + '\n');

    switch (err.code) {
      default:
        case 'PARSE_FAIL':
        if (!quiet) {
          process.stderr.write('\n' + err.stack + '\n');
        }
      break;

      case 'ENOENT':
          if (!quiet) {
            process.stderr.write('\n' + err.stack.replace('ENOENT, lstat ', 'unable to find ') + '\n');
          }
        break;
    }
    callback(err);
  }
170491
function (err) {
		var storage = getStorage();
		if (storage && storage.errors) {
			storage.errors.push(err);
			return localStorage.setItem([config.nameSpace], JSON.stringify(storage));
		}
	}
1337615
function handleError(err) {
  let errMsg = err;

  if (err instanceof Object) {
    errMsg = err.message || err.error || JSON.stringify(err);
  }

  printColumns(chalk.red('Error: ' + errMsg));
  printColumns(
    chalk.white(
      "If you can't settle this, please open an issue at:" + EOL + chalk.cyan(pkg.bugs.url)
    )
  );
  process.exit(1);
}
789416
function errorJSON (err) {
  var res = {}
  Object.getOwnPropertyNames(err).forEach(function (key) {
    res[key] = err[key]
  }, err)
  return res
}
539191
function getImageSizeForSource(editor, src, callback) {
		var fileContent;
		if (src) {
			// check if it is data:url
			if (/^data:/.test(src)) {
				fileContent = base64.decode( src.replace(/^data\:.+?;.+?,/, '') );
				return callback(actionUtils.getImageSize(fileContent));
			}

			var filePath = editor.getFilePath();
			file.locateFile(filePath, src, function(absPath) {
				if (absPath === null) {
					throw "Can't find " + src + ' file';
				}

				file.read(absPath, function(err, content) {
					if (err) {
						throw 'Unable to read ' + absPath + ': ' + err;
					}

					content = String(content);
					callback(actionUtils.getImageSize(content));
				});
			});
		}
	}
515394
function getImageSize(element) {
            var imageObj = url.parse(element.attribs.src),
                requestOptions,
                timeout = 3000;

            if (!validator.isURL(imageObj.href)) {
                // revert this element, do not show
                element.name = 'img';

                return enter();
            }

            // We need the user-agent, otherwise some https request may fail (e. g. cloudfare)
            requestOptions = {
                headers: {
                    'User-Agent': 'Mozilla/5.0 Safari/537.36'
                },
                timeout: timeout,
                encoding: null
            };

            return got(
                imageObj.href,
                requestOptions
            ).then(function (response) {
                try {
                    // Using the Buffer rather than an URL requires to use sizeOf synchronously.
                    // See https://github.com/image-size/image-size#asynchronous
                    var dimensions = sizeOf(response.body);

                    // CASE: `.ico` files might have multiple images and therefore multiple sizes.
                    // We return the largest size found (image-size default is the first size found)
                    if (dimensions.images) {
                        dimensions.width = _.maxBy(dimensions.images, function (w) {return w.width;}).width;
                        dimensions.height = _.maxBy(dimensions.images, function (h) {return h.height;}).height;
                    }

                    element.attribs.width = dimensions.width;
                    element.attribs.height = dimensions.height;

                    return getLayoutAttribute(element);
                } catch (err) {
                    // revert this element, do not show
                    element.name = 'img';
                    return enter();
                }
            }).catch(function () {
                // revert this element, do not show
                element.name = 'img';
                return enter();
            });
        }
1374684
private JSONNavi<?> failure(String err, Object jPathPostfix) {
		failure = true;
		StringBuilder sb = new StringBuilder();
		sb.append("Error: ");
		sb.append(err);
		sb.append(" at ");
		sb.append(getJPath());
		if (jPathPostfix != null)
			if (jPathPostfix instanceof Integer)
				sb.append('[').append(jPathPostfix).append(']');
			else
				sb.append('/').append(jPathPostfix);
		this.failureMessage = sb.toString();
		return this;
	}
336254
function parse(data) {
  try {
    return JSON.parse(data);
  } catch (e) {
    log('Oops! Some problems parsing this ' + (typeof data === 'undefined' ? 'undefined' : _typeof(data)) + '.', 'error', debug);
  }

  return null;
}
408004
function(err){
			var indicator = lib.node(this._prefix+this._id);
			indicator.src = require.toUrl("images/problem.gif");
			indicator.className = "";
			
			new mTooltip.Tooltip({
				node: indicator,
				text: err
			});
		}
179993
function checkResponse(err, data) {
		if (err) {
			return callback(err);
		}

		responseParser.parse(data,
			{ format: this.format, logger: this.logger }, getTokens);
		function getTokens(err, tokenResponse) {
			var accessToken, accessSecret;

			if (err) {
				return callback(err);
			}

			return callback();
		}
	}
304010
public synchronized void fail (Throwable error) {
    if (pixelWidth == 0) pixelWidth = 50;
    if (pixelHeight == 0) pixelHeight = 50;
    setBitmap(createErrorBitmap(pixelWidth, pixelHeight));
    ((RPromise<Image>)state).fail(error); // state is a deferred promise
  }