Catching errors when using js_api
See original GitHub issueSpecification
- pywebview version: 3.4
- platform / version: Windows
Description
I am using a custom Api()
class to communicate Javascript withPython. My problem is any error/exception won’t show in the Python terminal. I can see the python error in the Chromium console, but I’d like to catch it in the terminal also.
This is the code:
if __name__ == '__main__':
api = Api()
window = webview.create_window('Wear Indicator Tool',
url="web/conexion.html",
js_api=api,
resizable=True,
min_size=(1200, 800),
)
webview.start(debug=True)
I believe the issue has to do more with threading than with pywebview, but I’m unable to solve it.
Any help is greatly appreciated.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Fetch: reject promise and catch the error if status is not OK?
Fetch promises only reject with a TypeError when a network error occurs. Since 4xx and 5xx responses aren't network errors, there's nothing ...
Read more >Error handling while using native fetch API in JavaScript
We will see, how to handle fetch API errors using promises and async await syntax in JavaScript.
Read more >JSAPI capturing errors in application and making d...
For example, today I saw an error in the console (here Google Chrome's console) of "TypeError", with a message of "undefined is not...
Read more >JavaScript Errors Try Catch Throw - W3Schools
JavaScript try and catch The try statement allows you to define a block of code to be tested for errors while it is...
Read more >A Comprehensive Guide To Error Handling In Node.js
The most common way for functions to deliver errors is by throwing them. When you throw an error, it becomes an exception and...
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 FreeTop 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
Top GitHub Comments
Yeah, this is a threading problem. You can wrap your threading code in try … except, display an exception and rethrow an exception if needed.
The message to post on the issue when closing it. If none provided, will not comment when closing an issue.