{"action":"created","issue":{"url":"https://api.github.com/repos/Financial-Times/o-errors/issues/20","labels_url":"https://api.github.com/repos/Financial-Times/o-errors/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/Financial-Times/o-errors/issues/20/comments","events_url":"https://api.github.com/repos/Financial-Times/o-errors/issues/20/events","html_url":"https://github.com/Financial-Times/o-errors/pull/20","id":109278822,"number":20,"title":"Add init option to pass an existing errorBuffer array","user":{"login":"phamann","id":80089,"avatar_url":"https://avatars.githubusercontent.com/u/80089?v=3","gravatar_id":"","url":"https://api.github.com/users/phamann","html_url":"https://github.com/phamann","followers_url":"https://api.github.com/users/phamann/followers","following_url":"https://api.github.com/users/phamann/following{/other_user}","gists_url":"https://api.github.com/users/phamann/gists{/gist_id}","starred_url":"https://api.github.com/users/phamann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phamann/subscriptions","organizations_url":"https://api.github.com/users/phamann/orgs","repos_url":"https://api.github.com/users/phamann/repos","events_url":"https://api.github.com/users/phamann/events{/privacy}","received_events_url":"https://api.github.com/users/phamann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-01T11:09:32Z","updated_at":"2015-10-01T12:27:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Financial-Times/o-errors/pulls/20","html_url":"https://github.com/Financial-Times/o-errors/pull/20","diff_url":"https://github.com/Financial-Times/o-errors/pull/20.diff","patch_url":"https://github.com/Financial-Times/o-errors/pull/20.patch"},"body":"On a rare occasion, one may have caught some errors inline within their page which they will want to beacon back to Sentry via oErrors. \r\n\r\nCurrently we have the internal `this._errorBuffer[]` which catches any errors in between calling `new oError` and `oError.init()`. This PR simply adds a new option `errorBuffer` to the init `options` hash which concats the passed array to the internal buffer to be flushed along with the existing ones.\r\n\r\n#### Use case:\r\nOn next.ft.com we have some HTTP/2 related connection errors which are preventing our main CSS from loading. We want to bind to `onError` of the `<link>` element and beacon those events back to Sentry to determine how often this is happening. \r\n\r\nAs the CSS is (quite rightly) very high up the `<head>` we have not yet instantiated oErrors and thus the need to capture the event separately and pass to oErrors when `init`'ing \r\n\r\n/cc @AlbertoElias @matthew-andrews "},"comment":{"url":"https://api.github.com/repos/Financial-Times/o-errors/issues/comments/144711818","html_url":"https://github.com/Financial-Times/o-errors/pull/20#issuecomment-144711818","issue_url":"https://api.github.com/repos/Financial-Times/o-errors/issues/20","id":144711818,"user":{"login":"AlbertoElias","id":913117,"avatar_url":"https://avatars.githubusercontent.com/u/913117?v=3","gravatar_id":"","url":"https://api.github.com/users/AlbertoElias","html_url":"https://github.com/AlbertoElias","followers_url":"https://api.github.com/users/AlbertoElias/followers","following_url":"https://api.github.com/users/AlbertoElias/following{/other_user}","gists_url":"https://api.github.com/users/AlbertoElias/gists{/gist_id}","starred_url":"https://api.github.com/users/AlbertoElias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlbertoElias/subscriptions","organizations_url":"https://api.github.com/users/AlbertoElias/orgs","repos_url":"https://api.github.com/users/AlbertoElias/repos","events_url":"https://api.github.com/users/AlbertoElias/events{/privacy}","received_events_url":"https://api.github.com/users/AlbertoElias/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T12:27:51Z","updated_at":"2015-10-01T12:27:51Z","body":"Left a comment, rest looks fine, I like this feature :+1: "}}