replaced panic with probe

This commit is contained in:
Anand Babu (AB) Periasamy
2015-08-22 23:25:11 -07:00
parent d8bb1e9fd6
commit 099b4478d6
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -72,8 +72,8 @@ func (a AliasMessage) String() string {
message += console.Colorize("URL", fmt.Sprintf("%s", a.URL))
return message
}
jsonMessageBytes, err := json.Marshal(a)
if err != nil {
jsonMessageBytes, e := json.Marshal(a)
if e != nil {
fatalIf(probe.NewError(e), "Unable to marshall into JSON.")
}
return string(jsonMessageBytes)
+2 -2
View File
@@ -56,8 +56,8 @@ func (c ContentMessage) String() string {
}()
return message
}
jsonMessageBytes, err := json.Marshal(c)
if err != nil {
jsonMessageBytes, e := json.Marshal(c)
if e != nil {
fatalIf(probe.NewError(e), "Unable to marshall into JSON.")
}
return string(jsonMessageBytes)
+2 -2
View File
@@ -58,8 +58,8 @@ func (s MirrorMessage) String() string {
if !globalJSONFlag {
return fmt.Sprintf("‘%s’ -> ‘%s’", s.Source, s.Targets)
}
mirrorMessageBytes, err := json.Marshal(s)
if err != nil {
mirrorMessageBytes, e := json.Marshal(s)
if e != nil {
fatalIf(probe.NewError(e), "Unable to marshall into JSON.")
}
return string(mirrorMessageBytes)