{"action":"closed","issue":{"url":"https://api.github.com/repos/Esri/esri-leaflet/issues/575","labels_url":"https://api.github.com/repos/Esri/esri-leaflet/issues/575/labels{/name}","comments_url":"https://api.github.com/repos/Esri/esri-leaflet/issues/575/comments","events_url":"https://api.github.com/repos/Esri/esri-leaflet/issues/575/events","html_url":"https://github.com/Esri/esri-leaflet/issues/575","id":93576229,"number":575,"title":"metadata requests with an invalid token don't trigger the callback","user":{"login":"jgravois","id":3011734,"avatar_url":"https://avatars.githubusercontent.com/u/3011734?v=3","gravatar_id":"","url":"https://api.github.com/users/jgravois","html_url":"https://github.com/jgravois","followers_url":"https://api.github.com/users/jgravois/followers","following_url":"https://api.github.com/users/jgravois/following{/other_user}","gists_url":"https://api.github.com/users/jgravois/gists{/gist_id}","starred_url":"https://api.github.com/users/jgravois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgravois/subscriptions","organizations_url":"https://api.github.com/users/jgravois/orgs","repos_url":"https://api.github.com/users/jgravois/repos","events_url":"https://api.github.com/users/jgravois/events{/privacy}","received_events_url":"https://api.github.com/users/jgravois/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Esri/esri-leaflet/labels/1.0","name":"1.0","color":"009800"},{"url":"https://api.github.com/repos/Esri/esri-leaflet/labels/Comments%20Needed","name":"Comments Needed","color":"207de5"},{"url":"https://api.github.com/repos/Esri/esri-leaflet/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-07-07T16:45:38Z","updated_at":"2015-07-10T16:53:40Z","closed_at":"2015-07-10T16:53:40Z","body":"```js\r\nL.esri.Services.service({\r\n  url: 'http://logistics.arcgis.com/arcgis/rest/services/World/ServiceAreas/GPServer/GenerateServiceAreas',\r\n  token: 'badtoken'\r\n}).metadata(function(error, response){\r\n  // never triggered\r\n  console.log(error);\r\n});\r\n```\r\nthis is because we currently:\r\n 1. trap authentication errors\r\n 2. push into `_requestQueue`\r\n 3. intentionally don't call the callback.\r\n\r\n(code [here](https://github.com/Esri/esri-leaflet/blob/master/src/Services/Service.js#L73-L80))\r\n\r\ni don't know enough about the other use case we are trying to support to know if/how we can best 'fix' this problem.  i was just surprised to see the error swallowed while working on jgravois/esri-leaflet-gp/issues/17"}}