{"action":"opened","issue":{"url":"https://api.github.com/repos/mozilla/pdf.js/issues/7513","repository_url":"https://api.github.com/repos/mozilla/pdf.js","labels_url":"https://api.github.com/repos/mozilla/pdf.js/issues/7513/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/pdf.js/issues/7513/comments","events_url":"https://api.github.com/repos/mozilla/pdf.js/issues/7513/events","html_url":"https://github.com/mozilla/pdf.js/issues/7513","id":168282182,"number":7513,"title":"Custom error handling on PDFJS.getDocument request failure","user":{"login":"xmityaz","id":10046613,"avatar_url":"https://avatars.githubusercontent.com/u/10046613?v=3","gravatar_id":"","url":"https://api.github.com/users/xmityaz","html_url":"https://github.com/xmityaz","followers_url":"https://api.github.com/users/xmityaz/followers","following_url":"https://api.github.com/users/xmityaz/following{/other_user}","gists_url":"https://api.github.com/users/xmityaz/gists{/gist_id}","starred_url":"https://api.github.com/users/xmityaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xmityaz/subscriptions","organizations_url":"https://api.github.com/users/xmityaz/orgs","repos_url":"https://api.github.com/users/xmityaz/repos","events_url":"https://api.github.com/users/xmityaz/events{/privacy}","received_events_url":"https://api.github.com/users/xmityaz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-29T09:08:28Z","updated_at":"2016-07-29T09:08:28Z","closed_at":null,"body":"I'm using `PDFJS.getDocument` request to load the pdf file. And in a case of any error from the server side, I'm expecting the specific error format in response from the server to show the notification message with the real reason of an error.\r\n\r\nThe approximate code:\r\n\r\n`PDFJS.getDocument($URL)`\r\n`.then(...)`\r\n`.catch(error => showErrorNotification(error));`\r\n\r\n\r\nBut if request failed inside catch, instead of the error from the server response I'm getting an `error` created inside [pdf.js _onError hanlder](https://github.com/mozilla/pdf.js/blob/122d4732398ca67381cc469dc2f49696b824c98d/src/core/network.js#L490). It has different data format and doesn't provide any data from original error (except error status)\r\n\r\nIs it possible to bind some custom error handler, before it will be handled inside pdf.js _onError function?"}}
{"actor":{"display_login":"xmityaz"}}