Skip to content
This repository has been archived by the owner on May 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #9 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 2.0.4
  • Loading branch information
andyone authored Jun 29, 2016
2 parents 2c4e9e1 + a1bcd6c commit 158897c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog

#### v2.0.4

* Improved error handling

#### v2.0.3

* Global prefix feature removed
Expand Down
7 changes: 6 additions & 1 deletion librato.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
// ////////////////////////////////////////////////////////////////////////////////// //

// VERSION contains current version of librato package and used as part of User-Agent
const VERSION = "2.0.3"
const VERSION = "2.0.4"

// ////////////////////////////////////////////////////////////////////////////////// //

Expand Down Expand Up @@ -655,6 +655,11 @@ func validateAnotation(a Annotation) error {
func extractErrors(data string) []error {
var err error

// Data doesn't looks like JSON. Return raw data
if !strings.HasPrefix(data, "{") {
return []error{fmt.Errorf(data)}
}

switch {
case strings.Contains(data, "\"params\":"):
errStruct := &paramsErrors{}
Expand Down

0 comments on commit 158897c

Please sign in to comment.