I’m writing a bug reporter for my app. When something goes wrong, the user fills out a form and describes the problem and this is sent to the server. As part of the data collected in this form, I’d like to include the last javascript error. Is there any way to do this?
Share
You could implement a function to capture errors by using
window.onerror(MDN documentation). That way the last error could be stored inwindow.localStorageor wherever you want and you could retrieve it again, when the bug report is filled.