I’ve been getting a lot of [An internal error has occurred] errors. My guess is that this happens when I use translated javascript with “from anvil.js.window import some_js_library” and an error occurs.
The confusing thing is that the error is in my python code, not in the translated JS code. Whenever the translated JS code handles some event which calls my python code which contains an error I get the [An internal error has occurred] instead of the more appropriate and more informative python error code.
The decorator makes sure that errors in your python code get reported in the usual way.
The problem with using callbacks is that anvil loses some control of the code.
The Javascript library might handle the exception in its own way.
It can also be useful to run the app in a new tab and open up the chrome console to see if there’s any additional error messages from Javascript.
It’s also on our list to improve the [An internal error has occurred] message to be more informative.