##// 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 b' def debuginstall(ui, **opts):'
1000 try:
1000 try:
1001 codecs.lookup(pycompat.sysstr(encoding.encoding))
1001 codecs.lookup(pycompat.sysstr(encoding.encoding))
1002 except LookupError as inst:
1002 except LookupError as inst:
1003 err = inst
1003 err = util.forcebytestr(inst)
1004 problems += 1
1004 problems += 1
1005 fm.condwrite(err, 'encodingerror', _(" %s\n"
1005 fm.condwrite(err, 'encodingerror', _(" %s\n"
1006 " (check that your locale is properly set)\n"), err)
1006 " (check that your locale is properly set)\n"), err)
@@ -1056,7 +1056,7 b' def debuginstall(ui, **opts):'
1056 )
1056 )
1057 dir(bdiff), dir(mpatch), dir(base85), dir(osutil) # quiet pyflakes
1057 dir(bdiff), dir(mpatch), dir(base85), dir(osutil) # quiet pyflakes
1058 except Exception as inst:
1058 except Exception as inst:
1059 err = inst
1059 err = util.forcebytestr(inst)
1060 problems += 1
1060 problems += 1
1061 fm.condwrite(err, 'extensionserror', " %s\n", err)
1061 fm.condwrite(err, 'extensionserror', " %s\n", err)
1062
1062
@@ -1088,7 +1088,7 b' def debuginstall(ui, **opts):'
1088 try:
1088 try:
1089 templater.templater.frommapfile(m)
1089 templater.templater.frommapfile(m)
1090 except Exception as inst:
1090 except Exception as inst:
1091 err = inst
1091 err = util.forcebytestr(inst)
1092 p = None
1092 p = None
1093 fm.condwrite(err, 'defaulttemplateerror', " %s\n", err)
1093 fm.condwrite(err, 'defaulttemplateerror', " %s\n", err)
1094 else:
1094 else:
@@ -1124,7 +1124,7 b' def debuginstall(ui, **opts):'
1124 try:
1124 try:
1125 username = ui.username()
1125 username = ui.username()
1126 except error.Abort as e:
1126 except error.Abort as e:
1127 err = e
1127 err = util.forcebytestr(e)
1128 problems += 1
1128 problems += 1
1129
1129
1130 fm.condwrite(username, 'username', _("checking username (%s)\n"), username)
1130 fm.condwrite(username, 'username', _("checking username (%s)\n"), username)
@@ -81,6 +81,14 b' hg debuginstall with invalid encoding'
81 checking encoding (invalidenc)...
81 checking encoding (invalidenc)...
82 unknown encoding: invalidenc
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 path variables are expanded (~ is the same as $TESTTMP)
92 path variables are expanded (~ is the same as $TESTTMP)
85 $ mkdir tools
93 $ mkdir tools
86 $ touch tools/testeditor.exe
94 $ touch tools/testeditor.exe
General Comments 0
You need to be logged in to leave comments. Login now