{"action":"created","issue":{"url":"https://api.github.com/repos/justinrainbow/json-schema/issues/364","repository_url":"https://api.github.com/repos/justinrainbow/json-schema","labels_url":"https://api.github.com/repos/justinrainbow/json-schema/issues/364/labels{/name}","comments_url":"https://api.github.com/repos/justinrainbow/json-schema/issues/364/comments","events_url":"https://api.github.com/repos/justinrainbow/json-schema/issues/364/events","html_url":"https://github.com/justinrainbow/json-schema/pull/364","id":210281552,"number":364,"title":"centralize errors","user":{"login":"shmax","id":773172,"avatar_url":"https://avatars3.githubusercontent.com/u/773172?v=3","gravatar_id":"","url":"https://api.github.com/users/shmax","html_url":"https://github.com/shmax","followers_url":"https://api.github.com/users/shmax/followers","following_url":"https://api.github.com/users/shmax/following{/other_user}","gists_url":"https://api.github.com/users/shmax/gists{/gist_id}","starred_url":"https://api.github.com/users/shmax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shmax/subscriptions","organizations_url":"https://api.github.com/users/shmax/orgs","repos_url":"https://api.github.com/users/shmax/repos","events_url":"https://api.github.com/users/shmax/events{/privacy}","received_events_url":"https://api.github.com/users/shmax/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":27,"created_at":"2017-02-26T03:35:14Z","updated_at":"2017-03-01T05:21:24Z","closed_at":"2017-02-28T23:10:41Z","pull_request":{"url":"https://api.github.com/repos/justinrainbow/json-schema/pulls/364","html_url":"https://github.com/justinrainbow/json-schema/pull/364","diff_url":"https://github.com/justinrainbow/json-schema/pull/364.diff","patch_url":"https://github.com/justinrainbow/json-schema/pull/364.patch"},"body":"Some improvements to the error system in an effort to make things a little easier for people interested in adding localization, such as https://github.com/justinrainbow/json-schema/issues/363:\r\n\r\n* Added a new class: `ConstraintError`. This extends an `enum` class which I've brought into the project to ensure that nobody types constraint types or messages directly into the code (by typehinting `addError`). I've used it before in a number of projects and have found it quite useful. \r\n\r\n* Converted all error strings into a format that can be passed to `sprintf`.\r\n\r\n* I had to invent a few new format error types to avoid ambiguity: `phoneFormat`, `ipFormat`, `styleFormat`, `timeFormat`, `urlFormat`. \r\n\r\n@bighappyface @erayd @harej"},"comment":{"url":"https://api.github.com/repos/justinrainbow/json-schema/issues/comments/283247810","html_url":"https://github.com/justinrainbow/json-schema/pull/364#issuecomment-283247810","issue_url":"https://api.github.com/repos/justinrainbow/json-schema/issues/364","id":283247810,"user":{"login":"shmax","id":773172,"avatar_url":"https://avatars3.githubusercontent.com/u/773172?v=3","gravatar_id":"","url":"https://api.github.com/users/shmax","html_url":"https://github.com/shmax","followers_url":"https://api.github.com/users/shmax/followers","following_url":"https://api.github.com/users/shmax/following{/other_user}","gists_url":"https://api.github.com/users/shmax/gists{/gist_id}","starred_url":"https://api.github.com/users/shmax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shmax/subscriptions","organizations_url":"https://api.github.com/users/shmax/orgs","repos_url":"https://api.github.com/users/shmax/repos","events_url":"https://api.github.com/users/shmax/events{/privacy}","received_events_url":"https://api.github.com/users/shmax/received_events","type":"User","site_admin":false},"created_at":"2017-03-01T05:21:24Z","updated_at":"2017-03-01T05:21:24Z","body":"> It doesn't need to break if you add a simple typecheck to the method\r\n\r\nIt would break if they were overriding the method in their subclass (because it would get called by our code, which passes in a `ConstraintError`) and doing something with what they believe to be a string. But if you guys are willing to waive that possibility, then it's okay with me."}}
{"actor":{"display_login":"shmax"}}