Closed abidlabs closed 1 month ago
• | Name | Status | URL |
---|---|---|---|
Spaces | ready! | Spaces preview | |
Website | ready! | Website preview | |
:unicorn: | Changes | detecting... |
Install Gradio from this PR
pip install https://gradio-builds.s3.amazonaws.com/8d91c14aa50754fca4fceb1f8f9582923a3523f0/gradio-4.31.0-py3-none-any.whl
Install Gradio Python Client from this PR
pip install "gradio-client @ git+https://github.com/gradio-app/gradio@8d91c14aa50754fca4fceb1f8f9582923a3523f0#subdirectory=client/python"
Package | Version |
---|---|
gradio |
patch |
gradio_client |
patch |
Make exceptions in the Client more specific
Maintainers or the PR author can modify the PR title to modify this entry.
Thanks @freddyaboulton for the review!
Previously, If an exception was raised in the upstream app due to an invalid value provided by the Python Client, then the error that is raised is not very informative:
My initial thought was to transmit the error from the server to the client to provide better error messages. However, we intentionally do not reveal exceptions to users of Gradio applications as they can reveal security vulnerabilities, unless
show_error=True
.So this PR only prints the upstream exception if
show_error=True
, otherwise prints a generic error explaining how to print more detailed errors. For other types of errors that the Client can generate, e.g. when an invalid parameter is provided, it changes the errors to beTypeError
instead ofValueError
-- that's consistent with the error type that is raised when you call a function in Python with the wrong parameters.Closes: https://github.com/gradio-app/gradio/issues/7889