{"action":"created","comment":{"url":"https://api.github.com/repos/strongloop/strong-error-handler/pulls/comments/95036003","pull_request_review_id":15583237,"id":95036003,"diff_hunk":"@@ -49,90 +37,84 @@ app.use(errorHandler({\n app.listen(3000);\n ```\n \n-In LoopBack applications, add the following entry to your\n-`server/middleware.json` file.\n+In LoopBack applications, add the following entry to `server/middleware.json`:\n \n ```json\n {\n   \"final:after\": {\n     \"strong-error-handler\": {\n       \"params\": {\n          \"debug\": false,\n-         \"log\": true,\n+         \"log\": true\n        }\n     }\n   }\n }\n ```\n \n-## Content Type\n+The above configuration will log errors to the server console, but not return stack traces in HTTP responses.\n+For details on configuration options, see below.\n \n-Depending on the request header's `Accepts`, response will be returned in\n- the corresponding content-type, current supported types include:\n-- JSON (`json`/`application/json`)\n-- HTML (`html`/`text/html`)\n+### Response format and content type\n \n-*There are plans to support other formats such as Text and XML.*\n+The `strong-error-handler` package supports HTML and JSON responses:\n \n-## Options\n-\n-#### debug\n-\n-`boolean`, defaults to `false`.\n+- When the object is a standard Error object, it returns the string provided by the stack property in HTML/text\n+  responses.\n+- When the object is a non-Error object, it returns the result of `util.inspect` in HTML/text responses.\n+- For JSON responses, the result is an object with all enumerable properties from the object in the response.\n \n-If you need to set the environment to development mode, you will need to change the value to `true`.\n+The content type of the response depends on the request's `Accepts` header.\n \n-When enabled, HTTP responses include all error properties, including\n-sensitive data such as file paths, URLs and stack traces. *See Examples below*\n+-  For Accepts header `json` or `application/json`, the response content type is JSON.\n+-  For Accepts header `html` or `text/html`, the response content type is HTML.\n \n-#### log\n+*There are plans to support other formats such as Text and XML.*\n \n-`boolean`, defaults to `true`.\n+## Options\n \n-When enabled, all errors are printed via `console.error`. That includes an array of fields (custom error properties)\n- that are safe to include in response messages (both 4xx and 5xx).\n+| Option | Type | Default | Description |","path":"README.md","position":108,"original_position":108,"commit_id":"fd31ffaa03c79685374ab18fbe1c924e6424b89d","original_commit_id":"9cc3d9786345ec6389bd8d0432c741c21ffecd39","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},"body":"> On the other hand, most packages on npm use the narrative format...\r\n\r\nI don't think that's true.  There are certainly packages that use both, but the following use tables for option/parameter reference:\r\n- Express [not surprising since I own this doc ;-) ] e.g. http://expressjs.com/en/4x/api.html#express \r\n- AngularJS e.g. https://docs.angularjs.org/api/ng/function/angular.bind\r\n- Sails: e.g. http://sailsjs.com/documentation/reference/waterline-orm/queries/exec\r\n- http://sailsjs.com/documentation/reference/blueprint-api/add-to\r\nMongoDB e.g. https://docs.mongodb.com/manual/reference/method/db.collection.find/\r\n\r\nOthers: Blueprint, KeystoneJS, etc. etc.\r\n\r\nTo be clear, I'm lumping API reference doc for method parameters together with doc for JSON options here, but the two are similar enough that it's apt.\r\n\r\nThere are of course MANY Node packages that **do** use narrative formatting as well, so I don't think one can claim either is an overwhelming standard. \r\n\r\nIn any case, LoopBack docs (both on loopback.io and apidocs.strongloop.com) use tables for this type of reference material, so I don't see why this should be an exception.\r\n\r\n>  I have personally run into this issue many times, but never bothered to report it....\r\n\r\nWell that's good to know, and it's simple enough to add an anchor in a table row for this purpose as needed (I just tested this and it works).  In this particular case, I think it's moot since there are only two options, so linking to the section head is virtually the same as linking to the table row.","created_at":"2017-01-06T22:59:47Z","updated_at":"2017-01-06T22:59:47Z","html_url":"https://github.com/strongloop/strong-error-handler/pull/36#discussion_r95036003","pull_request_url":"https://api.github.com/repos/strongloop/strong-error-handler/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/strongloop/strong-error-handler/pulls/comments/95036003"},"html":{"href":"https://github.com/strongloop/strong-error-handler/pull/36#discussion_r95036003"},"pull_request":{"href":"https://api.github.com/repos/strongloop/strong-error-handler/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/strongloop/strong-error-handler/pulls/36","id":100200362,"html_url":"https://github.com/strongloop/strong-error-handler/pull/36","diff_url":"https://github.com/strongloop/strong-error-handler/pull/36.diff","patch_url":"https://github.com/strongloop/strong-error-handler/pull/36.patch","issue_url":"https://api.github.com/repos/strongloop/strong-error-handler/issues/36","number":36,"state":"open","locked":false,"title":"Readme cleanup","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},"body":"@bajtos \r\nThis is primarily formatting, but also some content corrections/clarifications.  \r\n\r\nNote that some of the peculiarities (e.g. use of `<pre>` tags in ordered list) is to ensure proper layout on loopback.io, however the README will also display properly in GitHub.","created_at":"2017-01-04T22:25:35Z","updated_at":"2017-01-06T22:59:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c7c70cb384f1b28258182656f10c2d6487c4722","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/strongloop/strong-error-handler/pulls/36/commits","review_comments_url":"https://api.github.com/repos/strongloop/strong-error-handler/pulls/36/comments","review_comment_url":"https://api.github.com/repos/strongloop/strong-error-handler/pulls/comments{/number}","comments_url":"https://api.github.com/repos/strongloop/strong-error-handler/issues/36/comments","statuses_url":"https://api.github.com/repos/strongloop/strong-error-handler/statuses/fd31ffaa03c79685374ab18fbe1c924e6424b89d","head":{"label":"strongloop:readme-cleanup","ref":"readme-cleanup","sha":"fd31ffaa03c79685374ab18fbe1c924e6424b89d","user":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=3","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"repo":{"id":50195364,"name":"strong-error-handler","full_name":"strongloop/strong-error-handler","owner":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=3","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/strongloop/strong-error-handler","description":"Error handler for use in development (debug) and production environments.","fork":false,"url":"https://api.github.com/repos/strongloop/strong-error-handler","forks_url":"https://api.github.com/repos/strongloop/strong-error-handler/forks","keys_url":"https://api.github.com/repos/strongloop/strong-error-handler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/strongloop/strong-error-handler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/strongloop/strong-error-handler/teams","hooks_url":"https://api.github.com/repos/strongloop/strong-error-handler/hooks","issue_events_url":"https://api.github.com/repos/strongloop/strong-error-handler/issues/events{/number}","events_url":"https://api.github.com/repos/strongloop/strong-error-handler/events","assignees_url":"https://api.github.com/repos/strongloop/strong-error-handler/assignees{/user}","branches_url":"https://api.github.com/repos/strongloop/strong-error-handler/branches{/branch}","tags_url":"https://api.github.com/repos/strongloop/strong-error-handler/tags","blobs_url":"https://api.github.com/repos/strongloop/strong-error-handler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/strongloop/strong-error-handler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/strongloop/strong-error-handler/git/refs{/sha}","trees_url":"https://api.github.com/repos/strongloop/strong-error-handler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/strongloop/strong-error-handler/statuses/{sha}","languages_url":"https://api.github.com/repos/strongloop/strong-error-handler/languages","stargazers_url":"https://api.github.com/repos/strongloop/strong-error-handler/stargazers","contributors_url":"https://api.github.com/repos/strongloop/strong-error-handler/contributors","subscribers_url":"https://api.github.com/repos/strongloop/strong-error-handler/subscribers","subscription_url":"https://api.github.com/repos/strongloop/strong-error-handler/subscription","commits_url":"https://api.github.com/repos/strongloop/strong-error-handler/commits{/sha}","git_commits_url":"https://api.github.com/repos/strongloop/strong-error-handler/git/commits{/sha}","comments_url":"https://api.github.com/repos/strongloop/strong-error-handler/comments{/number}","issue_comment_url":"https://api.github.com/repos/strongloop/strong-error-handler/issues/comments{/number}","contents_url":"https://api.github.com/repos/strongloop/strong-error-handler/contents/{+path}","compare_url":"https://api.github.com/repos/strongloop/strong-error-handler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/strongloop/strong-error-handler/merges","archive_url":"https://api.github.com/repos/strongloop/strong-error-handler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/strongloop/strong-error-handler/downloads","issues_url":"https://api.github.com/repos/strongloop/strong-error-handler/issues{/number}","pulls_url":"https://api.github.com/repos/strongloop/strong-error-handler/pulls{/number}","milestones_url":"https://api.github.com/repos/strongloop/strong-error-handler/milestones{/number}","notifications_url":"https://api.github.com/repos/strongloop/strong-error-handler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/strongloop/strong-error-handler/labels{/name}","releases_url":"https://api.github.com/repos/strongloop/strong-error-handler/releases{/id}","deployments_url":"https://api.github.com/repos/strongloop/strong-error-handler/deployments","created_at":"2016-01-22T17:08:22Z","updated_at":"2016-12-30T00:25:26Z","pushed_at":"2017-01-06T00:04:09Z","git_url":"git://github.com/strongloop/strong-error-handler.git","ssh_url":"git@github.com:strongloop/strong-error-handler.git","clone_url":"https://github.com/strongloop/strong-error-handler.git","svn_url":"https://github.com/strongloop/strong-error-handler","homepage":"","size":37,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":12,"forks":6,"open_issues":12,"watchers":4,"default_branch":"master"}},"base":{"label":"strongloop:master","ref":"master","sha":"13ec01fb187f53e3257bdfccf71ab0bb580ae199","user":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=3","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"repo":{"id":50195364,"name":"strong-error-handler","full_name":"strongloop/strong-error-handler","owner":{"login":"strongloop","id":3020012,"avatar_url":"https://avatars.githubusercontent.com/u/3020012?v=3","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/strongloop/strong-error-handler","description":"Error handler for use in development (debug) and production environments.","fork":false,"url":"https://api.github.com/repos/strongloop/strong-error-handler","forks_url":"https://api.github.com/repos/strongloop/strong-error-handler/forks","keys_url":"https://api.github.com/repos/strongloop/strong-error-handler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/strongloop/strong-error-handler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/strongloop/strong-error-handler/teams","hooks_url":"https://api.github.com/repos/strongloop/strong-error-handler/hooks","issue_events_url":"https://api.github.com/repos/strongloop/strong-error-handler/issues/events{/number}","events_url":"https://api.github.com/repos/strongloop/strong-error-handler/events","assignees_url":"https://api.github.com/repos/strongloop/strong-error-handler/assignees{/user}","branches_url":"https://api.github.com/repos/strongloop/strong-error-handler/branches{/branch}","tags_url":"https://api.github.com/repos/strongloop/strong-error-handler/tags","blobs_url":"https://api.github.com/repos/strongloop/strong-error-handler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/strongloop/strong-error-handler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/strongloop/strong-error-handler/git/refs{/sha}","trees_url":"https://api.github.com/repos/strongloop/strong-error-handler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/strongloop/strong-error-handler/statuses/{sha}","languages_url":"https://api.github.com/repos/strongloop/strong-error-handler/languages","stargazers_url":"https://api.github.com/repos/strongloop/strong-error-handler/stargazers","contributors_url":"https://api.github.com/repos/strongloop/strong-error-handler/contributors","subscribers_url":"https://api.github.com/repos/strongloop/strong-error-handler/subscribers","subscription_url":"https://api.github.com/repos/strongloop/strong-error-handler/subscription","commits_url":"https://api.github.com/repos/strongloop/strong-error-handler/commits{/sha}","git_commits_url":"https://api.github.com/repos/strongloop/strong-error-handler/git/commits{/sha}","comments_url":"https://api.github.com/repos/strongloop/strong-error-handler/comments{/number}","issue_comment_url":"https://api.github.com/repos/strongloop/strong-error-handler/issues/comments{/number}","contents_url":"https://api.github.com/repos/strongloop/strong-error-handler/contents/{+path}","compare_url":"https://api.github.com/repos/strongloop/strong-error-handler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/strongloop/strong-error-handler/merges","archive_url":"https://api.github.com/repos/strongloop/strong-error-handler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/strongloop/strong-error-handler/downloads","issues_url":"https://api.github.com/repos/strongloop/strong-error-handler/issues{/number}","pulls_url":"https://api.github.com/repos/strongloop/strong-error-handler/pulls{/number}","milestones_url":"https://api.github.com/repos/strongloop/strong-error-handler/milestones{/number}","notifications_url":"https://api.github.com/repos/strongloop/strong-error-handler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/strongloop/strong-error-handler/labels{/name}","releases_url":"https://api.github.com/repos/strongloop/strong-error-handler/releases{/id}","deployments_url":"https://api.github.com/repos/strongloop/strong-error-handler/deployments","created_at":"2016-01-22T17:08:22Z","updated_at":"2016-12-30T00:25:26Z","pushed_at":"2017-01-06T00:04:09Z","git_url":"git://github.com/strongloop/strong-error-handler.git","ssh_url":"git@github.com:strongloop/strong-error-handler.git","clone_url":"https://github.com/strongloop/strong-error-handler.git","svn_url":"https://github.com/strongloop/strong-error-handler","homepage":"","size":37,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":12,"forks":6,"open_issues":12,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/strongloop/strong-error-handler/pulls/36"},"html":{"href":"https://github.com/strongloop/strong-error-handler/pull/36"},"issue":{"href":"https://api.github.com/repos/strongloop/strong-error-handler/issues/36"},"comments":{"href":"https://api.github.com/repos/strongloop/strong-error-handler/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/strongloop/strong-error-handler/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/strongloop/strong-error-handler/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/strongloop/strong-error-handler/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/strongloop/strong-error-handler/statuses/fd31ffaa03c79685374ab18fbe1c924e6424b89d"}}}}
{"actor":{"display_login":"crandmck"}}