Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: client/isolate/utils.go

Issue 2963503003: [errors] Greatly simplify common/errors package. (Closed)
Patch Set: fix nits Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cipd/client/cipd/ensure/template.go ('k') | common/config/impl/filesystem/fs.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/isolate/utils.go
diff --git a/client/isolate/utils.go b/client/isolate/utils.go
index b66ab49e66264eaa6e71b03458d83b9fef666558..83fa8f7a293b172f4c60cc4f7ed8dfee254a8e64 100644
--- a/client/isolate/utils.go
+++ b/client/isolate/utils.go
@@ -5,7 +5,6 @@
package isolate
import (
- "fmt"
"log"
"path"
"runtime"
@@ -20,7 +19,7 @@ func assertNoError(err error) {
if err == nil {
return
}
- log.Panic(errors.RenderStack(fmt.Errorf("assertion failed due to error: %s", err)).ToLines())
+ log.Panic(errors.RenderStack(errors.Annotate(err, "assertion failed").Err()))
}
func assert(condition bool, info ...interface{}) {
@@ -28,9 +27,9 @@ func assert(condition bool, info ...interface{}) {
return
}
if len(info) == 0 {
- log.Panic(errors.RenderStack(errors.New("assertion failed")).ToLines())
+ log.Panic(errors.RenderStack(errors.New("assertion failed")))
} else if format, ok := info[0].(string); ok {
- log.Panic(errors.RenderStack(fmt.Errorf("assertion failed: "+format, info[1:]...)).ToLines())
+ log.Panic(errors.RenderStack(errors.Reason("assertion failed: "+format, info[1:]...).Err()))
}
}
« no previous file with comments | « cipd/client/cipd/ensure/template.go ('k') | common/config/impl/filesystem/fs.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698