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

Unified Diff: common/data/text/stringtemplate/template.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 | « common/config/validation/validation.go ('k') | common/errors/annotate.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/data/text/stringtemplate/template.go
diff --git a/common/data/text/stringtemplate/template.go b/common/data/text/stringtemplate/template.go
index 1140c2dc4e10578a6c9cd3deeb3789ce18297145..007f17480cbb613a079fdecfd272999ced61c2fd 100644
--- a/common/data/text/stringtemplate/template.go
+++ b/common/data/text/stringtemplate/template.go
@@ -60,9 +60,7 @@ func Resolve(v string, subst map[string]string) (string, error) {
switch {
case match[8] >= 0:
// Invalid.
- return "", errors.Reason("invalid template: %(template)q").
- D("template", v).
- Err()
+ return "", errors.Reason("invalid template: %q", v).Err()
case match[2] >= 0:
// Escaped.
@@ -90,9 +88,7 @@ func Resolve(v string, subst map[string]string) (string, error) {
subst, ok := subst[key]
if !ok {
- return "", errors.Reason("no substitution for %(key)q").
- D("key", key).
- Err()
+ return "", errors.Reason("no substitution for %q", key).Err()
}
parts = append(parts, subst)
}
« no previous file with comments | « common/config/validation/validation.go ('k') | common/errors/annotate.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698