@ngdoc function
@name angular.errorHandlingConfig
@module ng
@kind function

@description
Configure several aspects of error handling in AngularJS if used as a setter or return the
current configuration if used as a getter. The following options are supported:

- **objectMaxDepth**: The maximum depth to which objects are traversed when stringified for error messages.

Omitted or undefined options will leave the corresponding configuration values unchanged.

@param {Object=} config - The configuration object. May only contain the options that need to be
updated. Supported keys:

* `objectMaxDepth`  **{Number}** - The max depth for stringifying objects. Setting to a
non-positive or non-numeric value, removes the max depth limit.
Default: 5

* `urlErrorParamsEnabled`  **{Boolean}** - Specifies wether the generated error url will
contain the parameters of the thrown error. Disabling the parameters can be useful if the
generated error url is very long.

Default: true. When used without argument, it returns the current value.
function errorHandlingConfig(config) {
  if (isObject(config)) {
    if (isDefined(config.objectMaxDepth)) {
      minErrConfig.objectMaxDepth = isValidObjectMaxDepth(config.objectMaxDepth) ? config.objectMaxDepth : NaN;
    }
    if (isDefined(config.urlErrorParamsEnabled) && isBoolean(config.urlErrorParamsEnabled)) {
      minErrConfig.urlErrorParamsEnabled = config.urlErrorParamsEnabled;
    }
  } else {
    return minErrConfig;
  }
}