HandlerError is a method to invoke when a non-user facing piece of code cannot return an error and needs to indicate it has been ignored. Invoking this method is preferable to logging the error - the default behavior is to log but the errors may be sent to a remote server for analysis.
(err error)
| 99 | // is preferable to logging the error - the default behavior is to log but the |
| 100 | // errors may be sent to a remote server for analysis. |
| 101 | func HandleError(err error) { |
| 102 | // this is sometimes called with a nil error. We probably shouldn't fail and should do nothing instead |
| 103 | if err == nil { |
| 104 | return |
| 105 | } |
| 106 | |
| 107 | for _, fn := range ErrorHandlers { |
| 108 | fn(err) |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | // logError prints an error with the call stack of the location it was reported |
| 113 | func logError(err error) { |
no outgoing calls