GopherCon 2016: Don't Just Check Errors Handle Them Gracefully - Dave Cheney

Поделиться
HTML-код
  • Опубликовано: 28 дек 2024

Комментарии • 25

  • @_slier
    @_slier 6 лет назад +30

    this should be part of standard library

    • @kamilziemian995
      @kamilziemian995 3 года назад

      Agree. Dave Cheney is a true treasure of Go community. He from time to time write code in wrong way, but I can't blame anyone of that, too much sins are on my side.

  • @csebastian3
    @csebastian3 8 лет назад +22

    Very good pacing on this presentation. I was able to follow along and really absorb what he was saying.

    • @csebastian3
      @csebastian3 8 лет назад

      Haha, thanks. I've been using this Chrono Trigger avatar for 6 years. In all that time, you're the first person to mention anything about it! I'm glad somebody else out there recognized it.

    • @lijack446
      @lijack446 4 года назад

      Now your profile picture is nine years old, isn't it? 👀

  • @kamilziemian995
    @kamilziemian995 3 года назад +1

    5:25 I think there is a typo and in if it should be "err.Error()". Otherwise, great talk.

  • @fangduan
    @fangduan 5 лет назад +4

    a frog in well is Chinese prob.

  • @hechen236
    @hechen236 3 года назад

    nice talk 👍

  • @mybigbeak
    @mybigbeak 8 лет назад +3

    Very practical. Where did you put your library?

    • @dn5426
      @dn5426 7 лет назад

      github.com/pkg/errors

  • @Huholoman
    @Huholoman 4 года назад

    F*ck yeah, thats what Ive been looking for :D

  • @shuzhi5856
    @shuzhi5856 4 года назад +1

    Definitely informative, thanks for sharing. However, at least to me I would argue errors are more of a message, and it feels weird to correspond message strongly with behaviors (e.g. a word doesn't always need to have a behavior). Even in the example of the presentation, I think checking if a message is temporary or not is more of a type or status check than about behaviors.

    • @aazzrwadrf
      @aazzrwadrf 3 года назад

      how else would you communicate that a network error occured?

  • @madcroc111
    @madcroc111 5 лет назад +8

    This starts to remind me of Exceptions, but done manually instead of automatically.

    • @Padeir0
      @Padeir0 4 года назад +1

      Exceptions are implicit, this is explicit. Very far from the same.

  • @colindev
    @colindev 8 лет назад

    github.com/colindev/x/tree/master/errors
    this demo is study follow this video
    but i am not sure it's correctly

    • @leixue7523
      @leixue7523 8 лет назад +1

      github.com/pkg/errors

  • @paracha3
    @paracha3 7 лет назад +6

    I played it at 1.25x just so i do not get bored with slow pace

  • @vorandrew
    @vorandrew 7 лет назад +2

    He is chewing it so sloooooooowly

  • @lxndr87i
    @lxndr87i 5 лет назад +3

    guys, just add try catch into Go

    • @justinkim7202
      @justinkim7202 4 года назад +3

      The whole reason why Go doesn't have the try catch syntax and intentionally use this pattern is to make it obvious which function may "throw" an error. With a try catch, it's not obvious to you which function/method throws an error and interrupts the execution flow. There's a nice blog that explains about this in the Go website. I personally prefer this approach to the try catch.

    • @defenestrated23
      @defenestrated23 4 года назад +3

      Try/catch is a crutch. Coming from Python, every time I find myself saying, "I wish I could just try-catch right now" it's a smell that my control flow isn't optimal. It breaks the Sequential part of Communicating Sequential Processes.
      Try/catch is GOTO with a bow tie and top hat.

  • @JakubSK
    @JakubSK 6 лет назад +1

    I'm sorry but this isn't a very good pattern, or somewhat antiquated with regard to older languages. Just as with concerns of monitoring and logging, error handling can too be subjective. A developer shouldn't be tasked with classifying an error, let alone determine which mechanism to use in conveyance.

    • @Padeir0
      @Padeir0 4 года назад

      If a developer doesn't classify the error who will? Will the machine just spit a hexdump and it's your problem?