Giter Club home page Giter Club logo

Comments (3)

nguyendangminh avatar nguyendangminh commented on August 24, 2024 1

One vote for @flexd

from slack.

dfc avatar dfc commented on August 24, 2024

I beat your dfc to the github registration finish line. Yay for me, but bad
if you were expecting a response. I just wanted to make sure you knew that
@mention didn't hit the right inbox...
On May 8, 2016 12:14, "Kristoffer Berdal" [email protected] wrote:

https://github.com/nlopes/slack/blob/master/admin.go#L21 is a good example
of bad errors.

That returns an error if something goes wrong, or it returns an error if
the API gives a error. How do we differentiate between those two states? I
can't show the API error to a user, because if it's a JSON Unmarshal error
that's not a good idea. And currently the only way of checking would be to
check if the error message contains a string, which is a bad idea.

@dfc https://github.com/dfc has a good set of examples on his blog
http://dave.cheney.net/2016/04/27/dont-just-check-errors-handle-them-gracefully
and has also made a very nice package that fits what he is saying
https://github.com/pkg/errors

What do you think?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/nlopes/slack/issues/72

from slack.

flexd avatar flexd commented on August 24, 2024

Oh, sorry! I'll correct that.

On 9 May 2016 04:50:11 CEST, Douglas Calvert [email protected] wrote:

I beat your dfc to the github registration finish line. Yay for me, but
bad
if you were expecting a response. I just wanted to make sure you knew
that
@mention didn't hit the right inbox...
On May 8, 2016 12:14, "Kristoffer Berdal" [email protected]
wrote:

https://github.com/nlopes/slack/blob/master/admin.go#L21 is a good
example
of bad errors.

That returns an error if something goes wrong, or it returns an error
if
the API gives a error. How do we differentiate between those two
states? I
can't show the API error to a user, because if it's a JSON Unmarshal
error
that's not a good idea. And currently the only way of checking would be
to
check if the error message contains a string, which is a bad idea.

@dfc https://github.com/dfc has a good set of examples on his blog
http://dave.cheney.net/2016/04/27/dont-just-check-errors-handle-them-gracefully
and has also made a very nice package that fits what he is saying
https://github.com/pkg/errors

What do you think?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/nlopes/slack/issues/72


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
https://github.com/nlopes/slack/issues/72#issuecomment-217765903

Sent from my Android device with K-9 Mail. Please excuse my brevity.

from slack.

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.