error is undefinied from OnError($event)
See original GitHub issue- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [x] Bug report -> please search issues before submitting
- [ ] Feature request
- [ ] Documentation issue or request
Hello, I don’t know if this behavior is normal but I’m having trouble getting details of an (intentional) error here is my PDF viewer in HTML
<pdf-viewer
[src]="PDF"
[render-text]="true"
style="display: block;"
(on-progress)="onProgress($event)"
(after-load-complete)='PDF_loaded()'
(error)="onError($event)">
</pdf-viewer>
and here is the onError function in the .TS
onError(errorPDF: any){console.log(errorPDF)}
the url of the pdf request returns a 404 error (as intended in my EXPRESS api )
res.status(404).send({ error: 'Not Found' });
In the chrome console i only get an ‘undefined’ for the ‘console.log (error PDF)’ Is it normal? Is there a way to get the code error thanks to the ‘OnError’ function?
Thanks
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Javascript: Which parameters are there for the onerror event ...
which I got from: javascript: how to display script errors in a popup alert? returns Error: [object Event] Script: undefined Line: undefined ......
Read more >event error handler javascript Undefined. - Telerik Forums
I am trying to use the events(e => e.Error("onError") in my grid that is ajax bound. I keep getting a javascript error "onError"...
Read more >Window: error event - Web APIs - MDN Web Docs - Mozilla
The error event is fired on a Window object when a resource failed to load or couldn't be used — for example if...
Read more >onerror Event - W3Schools
The onerror event is triggered if an error occurs while loading an external file (e.g. a document or an image). Tip: When used...
Read more >this._listeners.error is undefined · Issue #63 - GitHub
I'm running into the following scenario, I'm providing incorrect URL on perpouse with 0 retry option. const options = { connectionTimeout: ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Found it. The error message is a victim of minification. If you’re using the non-minified version of the pdf.worker.js, the error object has a sensible value. In my case, I’ve added this line to the app.module.ts:
Thanks @stephanrauh this fixes the issue. 😃