CR: export error string generation to a function

This commit is contained in:
Guy Lewin
2020-02-11 16:57:38 +02:00
parent 9440bc5d72
commit 98fa3855bd
4 changed files with 13 additions and 16 deletions

View File

@@ -101,3 +101,11 @@ func ParseRangeNumbers(rangeStr string) (numbers []int64, err error) {
}
return
}
func GenerateResponseErrorString(summary string, err error, detailed bool) string {
if detailed {
return err.Error()
} else {
return summary
}
}