{"action":"created","issue":{"url":"https://api.github.com/repos/manyminds/api2go/issues/195","labels_url":"https://api.github.com/repos/manyminds/api2go/issues/195/labels{/name}","comments_url":"https://api.github.com/repos/manyminds/api2go/issues/195/comments","events_url":"https://api.github.com/repos/manyminds/api2go/issues/195/events","html_url":"https://github.com/manyminds/api2go/issues/195","id":110576509,"number":195,"title":"jsonapi handling errors?","user":{"login":"faeronsayn","id":3820846,"avatar_url":"https://avatars.githubusercontent.com/u/3820846?v=3","gravatar_id":"","url":"https://api.github.com/users/faeronsayn","html_url":"https://github.com/faeronsayn","followers_url":"https://api.github.com/users/faeronsayn/followers","following_url":"https://api.github.com/users/faeronsayn/following{/other_user}","gists_url":"https://api.github.com/users/faeronsayn/gists{/gist_id}","starred_url":"https://api.github.com/users/faeronsayn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faeronsayn/subscriptions","organizations_url":"https://api.github.com/users/faeronsayn/orgs","repos_url":"https://api.github.com/users/faeronsayn/repos","events_url":"https://api.github.com/users/faeronsayn/events{/privacy}","received_events_url":"https://api.github.com/users/faeronsayn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/manyminds/api2go/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-09T02:25:51Z","updated_at":"2015-10-09T06:26:06Z","closed_at":null,"body":"How can we marshal errors into jsonapi compatible errors? "},"comment":{"url":"https://api.github.com/repos/manyminds/api2go/issues/comments/146768591","html_url":"https://github.com/manyminds/api2go/issues/195#issuecomment-146768591","issue_url":"https://api.github.com/repos/manyminds/api2go/issues/195","id":146768591,"user":{"login":"wwwdata","id":818880,"avatar_url":"https://avatars.githubusercontent.com/u/818880?v=3","gravatar_id":"","url":"https://api.github.com/users/wwwdata","html_url":"https://github.com/wwwdata","followers_url":"https://api.github.com/users/wwwdata/followers","following_url":"https://api.github.com/users/wwwdata/following{/other_user}","gists_url":"https://api.github.com/users/wwwdata/gists{/gist_id}","starred_url":"https://api.github.com/users/wwwdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wwwdata/subscriptions","organizations_url":"https://api.github.com/users/wwwdata/orgs","repos_url":"https://api.github.com/users/wwwdata/repos","events_url":"https://api.github.com/users/wwwdata/events{/privacy}","received_events_url":"https://api.github.com/users/wwwdata/received_events","type":"User","site_admin":false},"created_at":"2015-10-09T06:26:06Z","updated_at":"2015-10-09T06:26:06Z","body":"Hi, if you are using our api functionality, just return an instance of our `HTTPError` as `error`. This will get marshalled correctly: https://godoc.org/github.com/manyminds/api2go#HTTPError\r\nIf you return any other normal go like error, then this will also be marshalled into a json api compatible error, but always with the default status code 500. \r\n\r\nYou can create a new error with `NewHTTPError` https://godoc.org/github.com/manyminds/api2go#NewHTTPError\r\n\r\n@faeronsayn do you think we should add this to our documentation in this chapter? https://github.com/manyminds/api2go#building-a-rest-api\r\n"}}