News for hackers. Stuff that matters.
Re:The Go Programming Language, or: Why all C-like languages... by casualsuperman2 on Friday March 09, 2012 @06:23PM (#3686427)
And then in the code for handling the error, you can do

   switch err.(type) {
      case db.IOError:
          // Database exception here
      case io.FileNotFoundError:
          // File exception
      default:
          // Pass it to our caller for them to handle.
          return nil, err
   }
Which gives you the ability to selectively catch errors based on type.

There are no comments on this comment yet.