Add exit_on_error option for Server::run_server_on_rt#578
Merged
joseluisq merged 3 commits intostatic-web-server:masterfrom Nov 15, 2025
Merged
Add exit_on_error option for Server::run_server_on_rt#578joseluisq merged 3 commits intostatic-web-server:masterfrom
exit_on_error option for Server::run_server_on_rt#578joseluisq merged 3 commits intostatic-web-server:masterfrom
Conversation
entire process exits if the server fails to start
joseluisq
requested changes
Nov 14, 2025
Collaborator
joseluisq
left a comment
There was a problem hiding this comment.
Good idea, just a small update to make and fix formatting.
exit_on_error optionexit_on_error option for Server::run_server_on_rt
Co-authored-by: Jose Quintana <[email protected]>
joseluisq
requested changes
Nov 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add
exit_on_erroroption when starting server to choose if the entire process exits if the server fails to startDescription
Added
exit_on_erroras an additional argument torun_server_on_rt. When set totruethis exits the entire process if the server fails to start (the current behavior). When set to false the error is propagated to the caller ofrun_server_on_rt.run_standaloneandrun_as_servicedon't expose this parameter, passingtrueto keep the current behavior.Related Issue
Motivation and Context
I'm using
static-web-serveras a library and found it killed my entire program when it failed to start, but I need a more graceful exit (clean up, etc).How Has This Been Tested?
I ran
cargo testand all tests passed. This was on Linux.Screenshots (if appropriate):