Code Monkey home page Code Monkey logo

Comments (29)

abonander avatar abonander commented on June 15, 2024 1

@hatsunearu Congratulations on the new job! Don't worry about the sample project, I'll get it done.

from multipart.

HM0880 avatar HM0880 commented on June 15, 2024

I'm working on the hyper_client example now. I'll submit a PR when it's done.

from multipart.

abonander avatar abonander commented on June 15, 2024

@HM0880 Cheers! Feel free to take any of the others if you like, let me know if you need help.

from multipart.

hatsunearu avatar hatsunearu commented on June 15, 2024

Is hyper_server taken? I am interested in picking it up starting this weekend.

from multipart.

abonander avatar abonander commented on June 15, 2024

@hatsunearu not to my knowledge, feel free to take it up! I'll start tracking who's doing what in the issue.

from multipart.

White-Oak avatar White-Oak commented on June 15, 2024

Can i claim tiny_http one?

from multipart.

abonander avatar abonander commented on June 15, 2024

@White-Oak Sure, go right ahead!

from multipart.

abonander avatar abonander commented on June 15, 2024

@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.

abonander avatar abonander commented on June 15, 2024

@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 'called Result::unwrap() on an Err 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.

abonander avatar abonander commented on June 15, 2024

Merged #31, thanks for the tiny_http sample @White-Oak! Good work.

from multipart.

White-Oak avatar White-Oak commented on June 15, 2024

If noone minds I'll take the iron as well.

from multipart.

abonander avatar abonander commented on June 15, 2024

@White-Oak Go ahead! I'm sure if someone wanted it they'd have claimed it by now.

from multipart.

White-Oak avatar White-Oak commented on June 15, 2024

@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.

abonander avatar abonander commented on June 15, 2024

@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.

White-Oak avatar White-Oak commented on June 15, 2024

@cybergeek94 I'll wait for you to upgrade it.

from multipart.

abonander avatar abonander commented on June 15, 2024

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.

abonander avatar abonander commented on June 15, 2024

@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.

HM0880 avatar HM0880 commented on June 15, 2024

@cybergeek94 Yes, still interested. Work and life have been very busy lately. I hope to get to it soon. :)

from multipart.

White-Oak avatar White-Oak commented on June 15, 2024

@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.

abonander avatar abonander commented on June 15, 2024

@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.

hatsunearu avatar hatsunearu commented on June 15, 2024

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.

abonander avatar abonander commented on June 15, 2024

New integration coming: Nickel!

It'll need a sample project like the others. Anyone interested?

from multipart.

abonander avatar abonander commented on June 15, 2024

When #37 is merged, the lorem ipsum text file will be available under samples/.

from multipart.

abonander avatar abonander commented on June 15, 2024

Pinging @HM0880 @White-Oak @hatsunearu

You all still alive?

from multipart.

hatsunearu avatar hatsunearu commented on June 15, 2024

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.

HM0880 avatar HM0880 commented on June 15, 2024

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.

puhrez avatar puhrez commented on June 15, 2024

Hey! I'm interested in hyper_server, I'll get on it soon!

from multipart.

iamsebastian avatar iamsebastian commented on June 15, 2024

Just do a reference to the nickel.rs example: #48

from multipart.

abonander avatar abonander commented on June 15, 2024

All examples have been completed! Thanks all!

from multipart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.