lib/patch.js
function convertNullToNotFoundError (toModelName, ctx, cb) {
  if (ctx.result !== null) return cb()

  var fk = ctx.getArgByName('fk')
  var msg = 'Unknown "' + toModelName + '" id "' + fk + '".'
  var error = new Error(msg)
  error.statusCode = error.status = statusCodes.NOT_FOUND
  error.code = 'MODEL_NOT_FOUND'
  cb(error)
}
function convertNullToNotFoundError (toModelName, ctx, cb) {
  if (ctx.result !== null) return cb()

  var fk = ctx.getArgByName('fk')
  var msg = 'Unknown "' + toModelName + '" id "' + fk + '".'
  var error = new Error(msg)
  error.statusCode = error.status = statusCodes.NOT_FOUND
  error.code = 'MODEL_NOT_FOUND'
  cb(error)
}
function convertNullToNotFoundError ( toModelName , ctx , cb ) { if ( ctx . result !== null ) return cb ( ) var fk = ctx . getArgByName ( 'fk' ) var msg = 'Unknown "' + toModelName + '" id "' + fk + '".' var error = new Error ( msg ) error . statusCode = error . status = statusCodes . NOT_FOUND error . code = 'MODEL_NOT_FOUND' cb ( error ) }
Copied in its entirity from loopbacks Model class.
it was necessary to do so as this function is used
in the other code below
Copied in its entirity from loopbacks Model class . it was necessary to do so as this function is used in the other code below