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
Replace Box<dyn Error> with error enum #157
Open
haileys
wants to merge
38
commits into
tiny-http:master
Choose a base branch
from
haileys:no-error-box
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
131: Uncomment and fix detect_connection_closed test r=frewsxcv Pass locally but not sure if travis is configured correctly Cheers
130: Fix use of deprecated item: replaced by std::thread::sleep r=frewsxcv Hello, this fix some deprecated items on tests: ``` warning: use of deprecated item: replaced by `std::thread::sleep`, #[warn(deprecated)] on by default --> tests/network.rs:73:5 | 73 | thread::sleep_ms(100); | ^^^^^^^^^^^^^^^^ ``` Cheers
Since rustc_serialize is now deprecated, and since it is currently only used for the websockets example, limit the dependency to development only.
133: Pull in rustc_serialize as a dev dependency only r=frewsxcv Since rustc_serialize is now deprecated, and since it is currently only used for the websockets example, limit the dependency to development only.
Fix Travis CI url
Expand status codes
Fix `next_header_source` alignment
142: Bump dependencies r=frewsxcv a=Eijebong
README: Bump version nr. in the Installation section
Fix a small documentation typo
The project "encoding" appears to be unmaintained, and hasn't received an update since 2017. Unfortunately the "encoding" artifacts on crates.io do not contain the licenses for the project, which adds difficulty in auditing dependencies. Since "tiny-http" doesn't actually use the EncodingDecoder, this patch removes it and it's dependency on "encoding" in order to avoid complications resolving the "tiny-http" dependency story. Instead, I would suggest investigating migrating over to https://docs.rs/encoding_rs/0.8.13/encoding_rs/, which appears to be actively maintained by Mozilla. If this patch is accepted, would it be possible to get a release as well?
Expose chunked_threshold on Response. Fix tiny-http#149
AsciiExt was deprecated in 1.26.0
153: Remove the unused EncodingDecoder r=frewsxcv a=erickt The project "encoding" appears to be unmaintained, and hasn't received an update since 2017. Unfortunately the "encoding" artifacts on crates.io do not contain the licenses for the project, which adds difficulty in auditing dependencies. Since "tiny-http" doesn't actually use the EncodingDecoder, this patch removes it and it's dependency on "encoding" in order to avoid complications resolving the "tiny-http" dependency story. Instead, I would suggest investigating migrating over to https://docs.rs/encoding_rs/0.8.13/encoding_rs/, which appears to be actively maintained by Mozilla. If this patch is accepted, would it be possible to get a release as well? Co-authored-by: Erick Tryzelaar <etryzelaar@google.com>
Sorry for the delay. One problem with this, is that if you depend on the library without the SSL feature and match on the enum, then if the feature gets enabled your compilation will break. I think we should have an SSL error anyway, except that it would contain an opaque type. |
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.
This pull request replaces the use of a
Box<dyn Error>
inServer::new
and related methods with a plain old error enum instead.This is easier to work with as a consumer of tiny_http and makes it possible to handle errors exhaustively.
The first commit in this PR simply replaces the string error message about SSL requiring the
ssl
feature with aNewServerError::SslFeatureRequired
enum case.The second commit builds on this by making the
ServerConfig::ssl
field conditional on thessl
feature, making any attempt to start an SSL server without thessl
feature a compile time error. This change allowed me to then removeNewServerError::SslFeatureRequired
again.