err (domain, target) {
    return function (code) {
      const prefix = `[${domain}:${target}] `
      let message = ERRORS[code].apply(
        null,
        Array.prototype.slice.call(arguments, 1)
      )
      message = `${prefix}${message}
http://www.js-data.io/v3.0/docs/errors#${code}`
      return new Error(message)
    }
  }
Produce a factory function for making Error objects with the provided
metadata. Used throughout the various js-data components.

@example
import { utils } from 'js-data';
const errorFactory = utils.err('domain', 'target');
const error400 = errorFactory(400, 'expected type', 'actual type');
console.log(error400); // [Error: [domain:target] expected: expected type, found: string
http://www.js-data.io/v3.0/docs/errors#400]
@method utils.err
@param {string} domain Namespace.
@param {string} target Target.
@returns {Function} Factory function.
@since 3.0.0