{"action":"opened","issue":{"url":"https://api.github.com/repos/strongloop/loopback/issues/1563","labels_url":"https://api.github.com/repos/strongloop/loopback/issues/1563/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback/issues/1563/comments","events_url":"https://api.github.com/repos/strongloop/loopback/issues/1563/events","html_url":"https://github.com/strongloop/loopback/issues/1563","id":99087410,"number":1563,"title":"Document how to to reject the deletion of a model","user":{"login":"crandmck","id":2925364,"avatar_url":"https://avatars.githubusercontent.com/u/2925364?v=3","gravatar_id":"","url":"https://api.github.com/users/crandmck","html_url":"https://github.com/crandmck","followers_url":"https://api.github.com/users/crandmck/followers","following_url":"https://api.github.com/users/crandmck/following{/other_user}","gists_url":"https://api.github.com/users/crandmck/gists{/gist_id}","starred_url":"https://api.github.com/users/crandmck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crandmck/subscriptions","organizations_url":"https://api.github.com/users/crandmck/orgs","repos_url":"https://api.github.com/users/crandmck/repos","events_url":"https://api.github.com/users/crandmck/events{/privacy}","received_events_url":"https://api.github.com/users/crandmck/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-05T00:05:41Z","updated_at":"2015-08-05T00:05:41Z","closed_at":null,"body":"From the [Google Group post](https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!searchin/loopbackjs/before$20delete/loopbackjs/aBKyf0AmJ-A/yHpI01yBBQAJ)\r\n\r\n> you need to call done() with an error to abort the delete, or whatever op...(Document me!) \r\n.. maybe it should be explicitly mentioned that passing an error to \"done\" will abort... \r\n\r\nExample given is \r\n```\r\nif (subscriptions.length > 0) {\r\n  //Stop the deletion of this Client \r\n  var err = new Error(\"Client has an active subscription, cannot delete\");\r\n  err.statusCode = 400;\r\n  console.log(err.toString());\r\n  next(err);\r\n}else{\r\n  next();\r\n}\r\n```\r\nThis confuses me, though, because I don't see a call to `done()`.  I'm obviously missing something...\r\n\r\n@bajtos Can you please verify that this is the right approach and/or clarify.\r\n"}}