{"action":"created","issue":{"url":"https://api.github.com/repos/elixir-lang/plug/issues/379","repository_url":"https://api.github.com/repos/elixir-lang/plug","labels_url":"https://api.github.com/repos/elixir-lang/plug/issues/379/labels{/name}","comments_url":"https://api.github.com/repos/elixir-lang/plug/issues/379/comments","events_url":"https://api.github.com/repos/elixir-lang/plug/issues/379/events","html_url":"https://github.com/elixir-lang/plug/issues/379","id":147732446,"number":379,"title":"[Proposal] Plug.Debugger should handle content-negotiation","user":{"login":"docteurklein","id":109846,"avatar_url":"https://avatars.githubusercontent.com/u/109846?v=3","gravatar_id":"","url":"https://api.github.com/users/docteurklein","html_url":"https://github.com/docteurklein","followers_url":"https://api.github.com/users/docteurklein/followers","following_url":"https://api.github.com/users/docteurklein/following{/other_user}","gists_url":"https://api.github.com/users/docteurklein/gists{/gist_id}","starred_url":"https://api.github.com/users/docteurklein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docteurklein/subscriptions","organizations_url":"https://api.github.com/users/docteurklein/orgs","repos_url":"https://api.github.com/users/docteurklein/repos","events_url":"https://api.github.com/users/docteurklein/events{/privacy}","received_events_url":"https://api.github.com/users/docteurklein/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-04-12T12:14:26Z","updated_at":"2016-04-12T12:56:47Z","closed_at":null,"body":"Currently, (in phoenix), if `debug_errors` is true, a nice stack trace is displayed in html.\r\nEven if I make an `application/json` request, it will return me html.\r\n\r\nIs it possible to make the Debugger a little smarter, so that it renders the exception in json if I asked for json?\r\n\r\nMy only other choice is to disable entirely the debugger, and enable the ErrorHandler, implementing handle_errors and handling the rendering myself, loosing completely the nice html stack trace in my `browser` pipeline.\r\n"},"comment":{"url":"https://api.github.com/repos/elixir-lang/plug/issues/comments/208892299","html_url":"https://github.com/elixir-lang/plug/issues/379#issuecomment-208892299","issue_url":"https://api.github.com/repos/elixir-lang/plug/issues/379","id":208892299,"user":{"login":"docteurklein","id":109846,"avatar_url":"https://avatars.githubusercontent.com/u/109846?v=3","gravatar_id":"","url":"https://api.github.com/users/docteurklein","html_url":"https://github.com/docteurklein","followers_url":"https://api.github.com/users/docteurklein/followers","following_url":"https://api.github.com/users/docteurklein/following{/other_user}","gists_url":"https://api.github.com/users/docteurklein/gists{/gist_id}","starred_url":"https://api.github.com/users/docteurklein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docteurklein/subscriptions","organizations_url":"https://api.github.com/users/docteurklein/orgs","repos_url":"https://api.github.com/users/docteurklein/repos","events_url":"https://api.github.com/users/docteurklein/events{/privacy}","received_events_url":"https://api.github.com/users/docteurklein/received_events","type":"User","site_admin":false},"created_at":"2016-04-12T12:56:47Z","updated_at":"2016-04-12T12:56:47Z","body":"@josevalim Thanks! do you mean to write that in a guard, or some other way?\r\nI'm sorry but I don't know the exact syntax you meant."}}