{"action":"created","issue":{"url":"https://api.github.com/repos/davepacheco/node-verror/issues/10","repository_url":"https://api.github.com/repos/davepacheco/node-verror","labels_url":"https://api.github.com/repos/davepacheco/node-verror/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/davepacheco/node-verror/issues/10/comments","events_url":"https://api.github.com/repos/davepacheco/node-verror/issues/10/events","html_url":"https://github.com/davepacheco/node-verror/issues/10","id":29325634,"number":10,"title":"better support for extra properties on Errors","user":{"login":"davepacheco","id":532688,"avatar_url":"https://avatars.githubusercontent.com/u/532688?v=3","gravatar_id":"","url":"https://api.github.com/users/davepacheco","html_url":"https://github.com/davepacheco","followers_url":"https://api.github.com/users/davepacheco/followers","following_url":"https://api.github.com/users/davepacheco/following{/other_user}","gists_url":"https://api.github.com/users/davepacheco/gists{/gist_id}","starred_url":"https://api.github.com/users/davepacheco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davepacheco/subscriptions","organizations_url":"https://api.github.com/users/davepacheco/orgs","repos_url":"https://api.github.com/users/davepacheco/repos","events_url":"https://api.github.com/users/davepacheco/events{/privacy}","received_events_url":"https://api.github.com/users/davepacheco/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"davepacheco","id":532688,"avatar_url":"https://avatars.githubusercontent.com/u/532688?v=3","gravatar_id":"","url":"https://api.github.com/users/davepacheco","html_url":"https://github.com/davepacheco","followers_url":"https://api.github.com/users/davepacheco/followers","following_url":"https://api.github.com/users/davepacheco/following{/other_user}","gists_url":"https://api.github.com/users/davepacheco/gists{/gist_id}","starred_url":"https://api.github.com/users/davepacheco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davepacheco/subscriptions","organizations_url":"https://api.github.com/users/davepacheco/orgs","repos_url":"https://api.github.com/users/davepacheco/repos","events_url":"https://api.github.com/users/davepacheco/events{/privacy}","received_events_url":"https://api.github.com/users/davepacheco/received_events","type":"User","site_admin":false},"milestone":null,"comments":8,"created_at":"2014-03-13T04:41:13Z","updated_at":"2016-02-19T22:38:50Z","closed_at":null,"body":"It would be nice to support putting more properties on Errors.  That means:\r\n\r\n- making it easy to add properties (e.g., with an extra \"properties\" argument or something)\r\n- consider shallow-copying properties from the cause into the new Error, so that consumers don't have to look through causes to find details\r\n\r\nCC @jclulow @tjfontaine"},"comment":{"url":"https://api.github.com/repos/davepacheco/node-verror/issues/comments/186436988","html_url":"https://github.com/davepacheco/node-verror/issues/10#issuecomment-186436988","issue_url":"https://api.github.com/repos/davepacheco/node-verror/issues/10","id":186436988,"user":{"login":"davepacheco","id":532688,"avatar_url":"https://avatars.githubusercontent.com/u/532688?v=3","gravatar_id":"","url":"https://api.github.com/users/davepacheco","html_url":"https://github.com/davepacheco","followers_url":"https://api.github.com/users/davepacheco/followers","following_url":"https://api.github.com/users/davepacheco/following{/other_user}","gists_url":"https://api.github.com/users/davepacheco/gists{/gist_id}","starred_url":"https://api.github.com/users/davepacheco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davepacheco/subscriptions","organizations_url":"https://api.github.com/users/davepacheco/orgs","repos_url":"https://api.github.com/users/davepacheco/repos","events_url":"https://api.github.com/users/davepacheco/events{/privacy}","received_events_url":"https://api.github.com/users/davepacheco/received_events","type":"User","site_admin":false},"created_at":"2016-02-19T22:38:50Z","updated_at":"2016-02-19T22:38:50Z","body":"This still needs some cleanup and improved examples, but here's where I am right now:\r\nhttps://github.com/davepacheco/node-verror/tree/dev-issue-10\r\n\r\nI'd suggest checking out the new README.md.  Here are the non-trivial design choices I went with:\r\n\r\n* These extra properties are called \"information\" properties.  To specify them, you pass them as an \"info\" option to the constructor.  (See the README.md.)\r\n* To get these properties out, you use the info() method to return an object containing all of the properties for this error and its whole cause chain.  This inheritance behavior is important to us because we want you to be able to wrap any VError with another one without losing the info properties.\r\n* Notably, this does *not* expose the properties as top-level properties on the Error.  We thought it was nearly as convenient to have them returned by info(), but this allows more flexibility, and also allows you to dump all of these properties without dumping the VError-internal properties.\r\n\r\nI'd be interested in feedback on this (CC @jclulow).\r\n\r\nThe full diff is here, but includes a ton of noise because as part of this change I'm bringing a bunch of other stuff up to date:\r\nhttps://github.com/davepacheco/node-verror/compare/dev-issue-10\r\n\r\nUnrelated changes I made as part of this:\r\n\r\n* major README.md rewrite\r\n* pull in catest for a test runner\r\n* update Makefiles for more efficient \"check\" targets\r\n* normalize VError, WError, and SError so that they all process constructor arguments exactly the same way, and update tests to reflect that"}}