Guest User

Untitled

a guest
Feb 23rd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. type SyntaxError struct {
  2. msg string // description of error
  3. // error occurred after reading Offset bytes, from which line and columnnr can be obtained
  4. Offset int64
  5. }
  6.  
  7. func (e *SyntaxError) String() string { return e.msg }
  8.  
  9.  
  10. if serr, ok := err.(*json.SyntaxError); ok {
  11. line, col := findLine(f, serr.Offset)
  12. return fmt.Errorf("%s:%d:%d: %v", f.Name(), line, col, err)
  13. }
  14.  
  15.  
  16. package net
  17. type Error interface {
  18. Timeout() bool // Is the error a timeout?
  19. Temporary() bool // Is the error temporary?
  20. }
Add Comment
Please, Sign In to add comment