-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more error handling & ElasticSearch Mapping.
- Loading branch information
Showing
2 changed files
with
58 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
) | ||
|
||
// ErrorOut writes a formated error-message to StdErr. | ||
func ErrorOut(format string, a ...interface{}) (int, error) { | ||
return fmt.Fprintf(os.Stderr, "[E] "+format, a...) | ||
} | ||
|
||
// PrintError prints the supplied error to StdErr. | ||
func PrintError(err error) (int, error) { | ||
return ErrorOut("%v\n", err) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters