mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-05 11:10:03 +08:00
Detailed error message for wasm_utils.get_registered_app() (#7572)
* Detailed error message for wasm_utils.get_registered_app() * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Ali Abdalla <ali.si3luwa@gmail.com>
This commit is contained in:
parent
f67759dcee
commit
7d3c868d0a
5
.changeset/major-results-stick.md
Normal file
5
.changeset/major-results-stick.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"gradio": minor
|
||||
---
|
||||
|
||||
feat:Detailed error message for wasm_utils.get_registered_app()
|
@ -46,5 +46,14 @@ def register_app(_app):
|
||||
app_map[app_id] = _app
|
||||
|
||||
|
||||
class GradioAppNotFoundError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def get_registered_app(app_id: str):
|
||||
return app_map[app_id]
|
||||
try:
|
||||
return app_map[app_id]
|
||||
except KeyError as e:
|
||||
raise GradioAppNotFoundError(
|
||||
f"Gradio app not found (ID: {app_id}). Forgot to call demo.launch()?"
|
||||
) from e
|
||||
|
Loading…
Reference in New Issue
Block a user