Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server: catch Python exceptions from plugins #31299

Merged
merged 3 commits into from
Aug 20, 2019

Conversation

elpaso
Copy link
Contributor

@elpaso elpaso commented Aug 19, 2019

Make sure Python exceptions are converted into
QgsServerException and catched by the main
service executor.

@elpaso
Copy link
Contributor Author

elpaso commented Aug 19, 2019

@rldhont @pblottiere @dmarteau I know we should make some housekeeping on the exception hierarchy/handling, but for now this seems a decent solution in order to catch Python errors coming from the plugin's code.

@elpaso elpaso force-pushed the server-python-catch-plugins-exceptions branch from 65bbd3d to f090919 Compare August 19, 2019 14:56
@rldhont rldhont added the Server Related to QGIS server label Aug 19, 2019
@rldhont rldhont added this to the 3.10.0 milestone Aug 19, 2019
Make sure Python exceptions are converted into
QgsServerException and catched by the main
service executor.

Without this patch, the server process is terminated
(aborted).
@elpaso elpaso force-pushed the server-python-catch-plugins-exceptions branch from f090919 to 4cc7a0f Compare August 19, 2019 16:32
* Returns the list of content types this handler can serve, default to JSON and HTML.
* In case a specialized type (such as GEOJSON) is supported,
* the generic type (such as JSON) should not be listed.
* \note not available in Python bindings
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\since

@pblottiere
Copy link
Member

but for now this seems a decent solution in order to catch Python errors coming from the plugin's code.

Good move 👍. Tanks @elpaso!

@elpaso elpaso merged commit 0897b4e into qgis:master Aug 20, 2019
@elpaso elpaso deleted the server-python-catch-plugins-exceptions branch August 20, 2019 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Server Related to QGIS server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants