From 4b6d0ce14b8553a93b2d14fd858dfd35bfd61104 Mon Sep 17 00:00:00 2001 From: "Joe Richey joerichey@google.com" Date: Tue, 23 May 2017 18:32:18 -0700 Subject: util: better handing of custom errors This commit changes how we handle InvalidInput and System errors. Instead of having formatting functions, the now just wrap a string and should be created with fmt.Sprintf or similar. We also move all of the error related code into a single place. Finally, the utils package gets additional functionality with MinInt64 and GetUsername, and the UnderlyingError function gets better logging. Note that this will break packages that depend on it. For instance, metadata and crypto currently do not build. This is fixed in a later commit. Change-Id: I819e4d1970604456a5b4b6a7c86426f180a6d092 --- util/util_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/util_test.go') diff --git a/util/util_test.go b/util/util_test.go index 65541b3..33ce2ff 100644 --- a/util/util_test.go +++ b/util/util_test.go @@ -44,7 +44,7 @@ func TestNeverErrorPanic(t *testing.T) { } }() - err := SystemErrorF("Hello") + err := SystemError("Hello") NeverError(err) } -- cgit v1.2.3