##// END OF EJS Templates
debuginstall: do not pass exception object to formatter (issue5676)
Yuya Nishihara -
r34132:ada8a196 default
parent child Browse files
Show More
@@ -1000,7 +1000,7 def debuginstall(ui, **opts):
1000 1000 try:
1001 1001 codecs.lookup(pycompat.sysstr(encoding.encoding))
1002 1002 except LookupError as inst:
1003 err = inst
1003 err = util.forcebytestr(inst)
1004 1004 problems += 1
1005 1005 fm.condwrite(err, 'encodingerror', _(" %s\n"
1006 1006 " (check that your locale is properly set)\n"), err)
@@ -1056,7 +1056,7 def debuginstall(ui, **opts):
1056 1056 )
1057 1057 dir(bdiff), dir(mpatch), dir(base85), dir(osutil) # quiet pyflakes
1058 1058 except Exception as inst:
1059 err = inst
1059 err = util.forcebytestr(inst)
1060 1060 problems += 1
1061 1061 fm.condwrite(err, 'extensionserror', " %s\n", err)
1062 1062
@@ -1088,7 +1088,7 def debuginstall(ui, **opts):
1088 1088 try:
1089 1089 templater.templater.frommapfile(m)
1090 1090 except Exception as inst:
1091 err = inst
1091 err = util.forcebytestr(inst)
1092 1092 p = None
1093 1093 fm.condwrite(err, 'defaulttemplateerror', " %s\n", err)
1094 1094 else:
@@ -1124,7 +1124,7 def debuginstall(ui, **opts):
1124 1124 try:
1125 1125 username = ui.username()
1126 1126 except error.Abort as e:
1127 err = e
1127 err = util.forcebytestr(e)
1128 1128 problems += 1
1129 1129
1130 1130 fm.condwrite(username, 'username', _("checking username (%s)\n"), username)
@@ -81,6 +81,14 hg debuginstall with invalid encoding
81 81 checking encoding (invalidenc)...
82 82 unknown encoding: invalidenc
83 83
84 exception message in JSON
85
86 $ HGENCODING=invalidenc HGUSER= hg debuginstall -Tjson | grep error
87 "defaulttemplateerror": null,
88 "encodingerror": "unknown encoding: invalidenc",
89 "extensionserror": null, (no-pure !)
90 "usernameerror": "no username supplied",
91
84 92 path variables are expanded (~ is the same as $TESTTMP)
85 93 $ mkdir tools
86 94 $ touch tools/testeditor.exe
General Comments 0
You need to be logged in to leave comments. Login now