Skip to content

Commit

Permalink
Add simple error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyDiamondstein committed Aug 11, 2017
1 parent fd21cde commit c8a19d2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions go/errors.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package main

import (
"log"
)

func handleError(err error, message string) {
if message == "" {
message = "Error making API call"
}
if err != nil {
log.Fatalf(message + ": %v", err.Error())
}
}

0 comments on commit c8a19d2

Please sign in to comment.