Comments (29)
@hatsunearu Congratulations on the new job! Don't worry about the sample project, I'll get it done.
from multipart.
I'm working on the hyper_client
example now. I'll submit a PR when it's done.
from multipart.
@HM0880 Cheers! Feel free to take any of the others if you like, let me know if you need help.
from multipart.
Is hyper_server
taken? I am interested in picking it up starting this weekend.
from multipart.
@hatsunearu not to my knowledge, feel free to take it up! I'll start tracking who's doing what in the issue.
from multipart.
Can i claim tiny_http
one?
from multipart.
@White-Oak Sure, go right ahead!
from multipart.
@HM0880 @hatsunearu @White-Oak So you guys know, I don't normally get on IRC so if you need help or advice just ping me on this issue or send me an email or a PM on reddit.
from multipart.
@HM0880 @hatsunearu A general note to keep in mind, based off @White-Oak's PR (#31):
.unwrap()
should be avoided where it makes more sense to recover from errors than panic, especially for the server-side where you don't want a single malformed request to bring down the whole server process.
This is still applicable to client applications which don't necessarily need to keep running after an error, as panics tend to pollute the console with information that don't mean much to end-users. Even without RUST_BACKTRACE=1
you'll still get something like:
thread '
' panicked at 'calledResult::unwrap()
on anErr
value: Error { repr: Os { code: 2, message: "No such file or directory" } }', ../src/libcore/result.rs:688`).
When the only relevant part of the message was "no such file or directory". This also makes it difficult to find the location that produced the error as the given file/line points to the definition of Result::unwrap()
; you have to turn backtraces on and sift back through them to find the actual error point.
Where possible, it's better to print the error message and continue/exit via regular control flow. You get a much nicer printout if you do something like:
// If the Ok(_) value doesn't mean anything:
if let Err(err) = <fallible operation here> {
println!("Error processing request: {}", err);
<continue or return>
}
// If you want the Ok(_) value:
match <fallible operation> {
Ok(val) => use_val(val),
Err(err) => {
println!("Error doing the thing: {}", err);
<continue or return>
},
}
The println!
statements above produce a much cleaner and more concise error message, and also add context which makes it much easier to find the problem without a backtrace (as you can just grep for the first part of the error message):
Error opening file: No such file or directory (os error 2)
Sometimes this can get pretty verbose for operations which you don't expect to fail often. In this case, .expect("Additional error information here")
is preferable to .unwrap()
, though it still produces a rather messy panic. You could also wrap the above operation in a macro if you're feeling clever.
from multipart.
Merged #31, thanks for the tiny_http
sample @White-Oak! Good work.
from multipart.
If noone minds I'll take the iron
as well.
from multipart.
@White-Oak Go ahead! I'm sure if someone wanted it they'd have claimed it by now.
from multipart.
@cybergeek94 hey, the most recent version of iron
is 0.3
, but you depend on 0.2
and there is something that breaks compatibility between these. Just wanted you to know.
from multipart.
@White-Oak can you open an issue on that? I'll upgrade it in a bit, or you can have a go at it if you want.
from multipart.
@cybergeek94 I'll wait for you to upgrade it.
from multipart.
Pinging @HM0880 @hatsunearu any progress on your ends? There's no hurry in finishing, you've just been inactive for a while and I'm wondering if you're still interested in doing this. If not, that's okay, I just have to know so I can make the tasks available for someone else.
from multipart.
@White-Oak you're the only one that's committed code so far so at this point this really only concerns you. I'm considering giving the sample projects a public domain/copyfree license like CC0 or WTFPL to eliminate any hindrances in using them to bootstrap a project. What do you think?
from multipart.
@cybergeek94 Yes, still interested. Work and life have been very busy lately. I hope to get to it soon. :)
from multipart.
@cybergeek94 I'm fine with public domain, but no WTFPL, please.
I have also looked into implementing 'hyper_reqbuilder' sample, so if you haven't started on it yet, I can make a PR.
from multipart.
@White-Oak Please, go ahead.
I can understand not wanting the WTFPL. I've also been looking at the Unlicense, which is probably the best one though I don't think it's necessary to go as far as requiring contributors to explicitly waive their copyrights and/or digitally sign a release.
from multipart.
I'm still interested. I'm also pretty busy with studies and life, and I hope to get it done in the coming weeks. I don't care about licenses, but Public Domain seems a bit more professional.
from multipart.
New integration coming: Nickel!
It'll need a sample project like the others. Anyone interested?
from multipart.
When #37 is merged, the lorem ipsum text file will be available under samples/
.
from multipart.
Pinging @HM0880 @White-Oak @hatsunearu
You all still alive?
from multipart.
Yeah, I just started work at NVIDIA and I have pretty much zero time to work on this unfortunately. I'm really sorry but I'll have to give up on it. If nobody does it after my next semester begins I might take a second shot at it.
Sorry about the mess.
On May 19, 2016 4:55 PM, Austin Bonander [email protected] wrote:
Pinging @HM0880https://github.com/HM0880 @White-Oakhttps://github.com/White-Oak @hatsunearuhttps://github.com/hatsunearu
You all still alive?
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHubhttps://github.com//issues/29#issuecomment-220481931
from multipart.
Yes, still alive and still interested! Am in the process of changing jobs, but that should calm down in a few weeks. I'd still love to do this, but if someone else is interested and is more available, feel free to give it to them.
from multipart.
Hey! I'm interested in hyper_server
, I'll get on it soon!
from multipart.
Just do a reference to the nickel.rs example: #48
from multipart.
All examples have been completed! Thanks all!
from multipart.
Related Issues (20)
- Rocket example no longer builds HOT 3
- Gotham example HOT 1
- Multipart.foreach_entry() panics on unseen keys, is it expected? HOT 9
- Cutting a release? HOT 8
- Saving a temp file with file extension HOT 2
- Calling `form.prepare()?.boundary()` twice panics HOT 2
- Unable to write multipart to file in rocket HOT 1
- How to save the file to server?
- how to support actix? HOT 1
- is there a way to use this with cgi? HOT 1
- Maintenance status/dependency bump request HOT 2
- bad issues, del this.
- Got MissingContentDisposition Error when parsing the response body of Multipart ranges
- Upgrade to rand 0.8 HOT 1
- "\r\n" straddling the buffer end is erroneously sent as part of the part's contents.
- hyper::server::Request
- Default features do not make sense HOT 2
- Can you help me figure how to make this work with Rust 2018? HOT 4
- twoway dependency is dead HOT 6
- the following packages contain code that will be rejected by a future version of Rust: multipart v0.18.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multipart.