{"action":"created","issue":{"url":"https://api.github.com/repos/jshttp/http-errors/issues/28","repository_url":"https://api.github.com/repos/jshttp/http-errors","labels_url":"https://api.github.com/repos/jshttp/http-errors/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/jshttp/http-errors/issues/28/comments","events_url":"https://api.github.com/repos/jshttp/http-errors/issues/28/events","html_url":"https://github.com/jshttp/http-errors/issues/28","id":144688669,"number":28,"title":"Usability in browsers (wrap `captureStackTrace`)","user":{"login":"dmitrizagidulin","id":947005,"avatar_url":"https://avatars.githubusercontent.com/u/947005?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitrizagidulin","html_url":"https://github.com/dmitrizagidulin","followers_url":"https://api.github.com/users/dmitrizagidulin/followers","following_url":"https://api.github.com/users/dmitrizagidulin/following{/other_user}","gists_url":"https://api.github.com/users/dmitrizagidulin/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitrizagidulin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitrizagidulin/subscriptions","organizations_url":"https://api.github.com/users/dmitrizagidulin/orgs","repos_url":"https://api.github.com/users/dmitrizagidulin/repos","events_url":"https://api.github.com/users/dmitrizagidulin/events{/privacy}","received_events_url":"https://api.github.com/users/dmitrizagidulin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"milestone":null,"comments":9,"created_at":"2016-03-30T18:58:43Z","updated_at":"2016-04-04T20:15:32Z","closed_at":"2016-04-04T20:15:32Z","body":"Is it possible to check for the existence of `Error.captureStackTrace()` before using it? \r\nI was trying to use `http-errors` on the browser side via Browserify, and it blew up with:\r\n\r\n`TypeError: Error.captureStackTrace is not a function` \r\n\r\n(on Firefox). \r\nAny way to check for its existence before using, since it's non-standard to some environments?"},"comment":{"url":"https://api.github.com/repos/jshttp/http-errors/issues/comments/205476098","html_url":"https://github.com/jshttp/http-errors/issues/28#issuecomment-205476098","issue_url":"https://api.github.com/repos/jshttp/http-errors/issues/28","id":205476098,"user":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"created_at":"2016-04-04T20:15:32Z","updated_at":"2016-04-04T20:15:32Z","body":"Not going to be acceptable, I'm sorry. If that is your scope, you can use an advanced transformer like Babel to remove the usage of non-browser-friendly APIs. If a change is made to this module, it has to be made in such a way were it is actually tested (reverting the change will make tests fail) and actually provide value to the users. If you are looking for this module but for a browser, many such module already exists.\r\n\r\nI have outlined the requirements it would take to make your change a reality here, as you were looking for. Any change inn the source code must be fully backed by tests, and are delivering a value to the users like \"this module works in a web browser\". If it does not provide that promise, then use a toolchain to conditionally replace this module with a browser-compatible one during your builds, or use a transformer to alter usages of `Error.captureStackTrace` throughout your entire code base without requiring everyone in your dependency chain to make modifications to satisfy your use-case if you are not willing to bring true browser support to this module."}}