Comments (2)
To resolve the "Unexpected error" message that appears when opening different pages in Apache Superset, which goes away upon refreshing the page, you can use the find_unexpected_errors
method from the WebDriverPlaywright
or WebDriverSelenium
classes to capture and handle these errors. This method identifies alert elements on the page and logs the error messages.
Here is an example of how you can use the find_unexpected_errors
method to capture and log unexpected errors:
from superset.utils.webdriver import WebDriverPlaywright, WebDriverSelenium
# Example using WebDriverPlaywright
def capture_errors_with_playwright(page):
unexpected_errors = WebDriverPlaywright.find_unexpected_errors(page)
if unexpected_errors:
for error in unexpected_errors:
print(f"Unexpected error found: {error}")
# Example using WebDriverSelenium
def capture_errors_with_selenium(driver):
unexpected_errors = WebDriverSelenium.find_unexpected_errors(driver)
if unexpected_errors:
for error in unexpected_errors:
print(f"Unexpected error found: {error}")
You can integrate these methods into your existing code where you handle page loads to ensure that any unexpected errors are captured and logged, which can help in diagnosing and resolving the issue.
Additionally, you can leverage the error handling mechanisms provided in superset/views/base.py
to better manage and log errors. For example, the json_error_response
and json_errors_response
functions can be used to format error messages consistently. You can also use the show_unexpected_exception
function to handle unexpected exceptions and log them appropriately.
Here is an example of how you can use these functions:
from superset.views.base import json_error_response, json_errors_response, show_unexpected_exception
from superset.errors import SupersetError, SupersetErrorType, ErrorLevel
def handle_unexpected_error(ex):
error = SupersetError(
message=str(ex),
error_type=SupersetErrorType.GENERIC_BACKEND_ERROR,
level=ErrorLevel.ERROR,
)
return json_errors_response(errors=[error], status=500)
try:
# Your code that might raise an unexpected error
pass
except Exception as ex:
response = handle_unexpected_error(ex)
print(response.get_data(as_text=True))
By using these built-in error handling functions, you can ensure that errors are logged and formatted consistently, making it easier to diagnose and resolve issues in Apache Superset [1][2].
To continue talking to Dosu, mention @dosu.
from superset.
Do you see any errors in the browser's console?
from superset.
Related Issues (20)
- Bar Chart: Bar Chart Echart X Axis and Y Axis labels not showing HOT 3
- The default URL generated by Dashboard has security risks! HOT 22
- Advanced Period filter bug HOT 2
- Switching languages doesn't take effect on some menu elements if BABEL_DEFAULT_LOCALE is not "en" HOT 11
- ENABLE_JAVASCRIPT_CONTROLS use HOT 2
- [SIP-144] Proposal to Integrate VisActor Visualization Plugin into Superset HOT 2
- Dashboard Color Scheme keeps changing every refresh HOT 4
- Bug: fetchGuestToken function is not called after internet is disconnected and error is encountered during embedded report access HOT 3
- The in-memory storage for tracking rate limits HOT 14
- Filtered values not appearing/not working after selected from dropdown Post Migration to Latest SS Version HOT 6
- Proxy is unable to function properly HOT 8
- Importing example dataset failes because of database constraint HOT 3
- DynamoDB Chart Failure HOT 1
- Unable to create/see datasets HOT 1
- [4.1.0rc1] Building Docker image from sources fails HOT 3
- `Error: Referenced columns not available in DataFrame` in Mixed Charts when one query has only nulls HOT 1
- Inconsistencies in the handling of misspelled URLs HOT 2
- AttributeError: 'Template' object has no attribute 'strip' HOT 3
- Embedded view shows only [Error: column "string" does not exist] HOT 2
- bug when updating chart /api/v1/chart/{pk} HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from superset.