Make your custom errors fly! | Advanced Rust Part 6

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 พ.ย. 2024

ความคิดเห็น • 20

  • @Maximus98245
    @Maximus98245 21 วันที่ผ่านมา

    A great demo of custom error handling in Rust! Eagerly awaiting next video in the Advanced Rust series...

  • @Hellbending
    @Hellbending 6 หลายเดือนก่อน +1

    I see my green tea boi?
    I click!
    Another banger brother 💪❤

  • @stephandaus8998
    @stephandaus8998 6 หลายเดือนก่อน +1

    Nice, I think you strike a nice balance regarding speed of explanations. I am still in a different industry but find myself increasingly more motivated for rust programming.

    • @GreenTeaCoding
      @GreenTeaCoding  6 หลายเดือนก่อน +1

      Thanks, that's exactly what I want to achieve with my videos. Quick enough to not bore people, but slow and thorough enough to be accessible for beginners and intermediates.

  • @brunoPaulino
    @brunoPaulino 3 หลายเดือนก่อน

    Fantastic breakdown on how to implement error handling well. I learned a ton with this video, specially the automatic conversion using From and the ? operator. Thanks for this Video!
    I'm now wondering what is the best way to handle REST API responses errors.
    I generally like to use Serde and Reqwest, but I'm still a bit fussy on how to convert error payloads back to a type that I can return as an error.
    Like, I have my type for the success case so Serde can deserialise, but how to properly deserialise the payload for a safe type when I get an error instead from the JSON payload?
    Thanks again!

  • @ChuvChuvee
    @ChuvChuvee 6 หลายเดือนก่อน

    Very well explained. Thanks

    • @GreenTeaCoding
      @GreenTeaCoding  6 หลายเดือนก่อน

      You're welcome! How long have you been programming Rust?

    • @ChuvChuvee
      @ChuvChuvee 6 หลายเดือนก่อน

      @@GreenTeaCoding about a year now. How to handle errors in a nice way was always a challenge. now you learned me how to do it

    • @GreenTeaCoding
      @GreenTeaCoding  6 หลายเดือนก่อน

      @@ChuvChuvee Yeah, the first year in Rust can be really rough. It get's really beautiful afterwards though!

  • @bbkr2063
    @bbkr2063 5 หลายเดือนก่อน

    Personally I would never shadow built-in Result type. That saves very little typing while making function signatures way harder to understand for other programmers while skimming the code.

  • @DeepakKumar-uz4xy
    @DeepakKumar-uz4xy 4 หลายเดือนก่อน

    can you please try to create tutorial on axum framework?

  • @AlexKubrinsky
    @AlexKubrinsky 4 หลายเดือนก่อน

    lets assume file contains billion of records, where second line is "bad". will map/collect iterate over all lines to fail later or it stops on first error?

  • @bbkr2063
    @bbkr2063 5 หลายเดือนก่อน

    CvsError would not pass any corporate inspection due to lack of consistency. FileIsEmpty but LineTooShort instead of LineIsTooShort? FileNotExistant (adjective) but CouldNotParseLine (verb) instead of LineNotParseable (adjective)? FileIsEmpty (present) but CouldNotOpenFile (past)? I know this was only toy code, but consistent error naming is super important to learn since day 0.
    Another reason why it would fail inspection is uncapped error size in CouldNotParseValue(String). That can be poisonous for log collecting and processing systems. Errors that copy user input as part of message should always be sanitized and capped.

    • @GreenTeaCoding
      @GreenTeaCoding  วันที่ผ่านมา +1

      You seem to be very knowledgeable and experienced, an I appreciate your feedback. I will try to improve on this points next time, thanks!

  • @brethagen7776
    @brethagen7776 6 หลายเดือนก่อน

    Do you plan on sharing the code from this example?

    • @GreenTeaCoding
      @GreenTeaCoding  6 หลายเดือนก่อน

      Fair request :)
      I added the Github repo link in the description.

  • @RahulSoshte
    @RahulSoshte 2 หลายเดือนก่อน

    I use anyhow

  • @RahulSoshte
    @RahulSoshte 2 หลายเดือนก่อน

    How much do you charge an hourly session to teach advanced Rust? I am a Rust Dev

    • @GreenTeaCoding
      @GreenTeaCoding  หลายเดือนก่อน

      I am currently not offering paid sessions.