dispatch: prompt 'eden doctor' for TApplicationException

Summary:
Many people hit TApplicationException recently. Most of them can be fixed
by `eden doctor`.  Instead of crashing and showing an unhelpful backtrace, show
a shorter error message and prompt the user to run `eden doctor`.

Reviewed By: fanzeyi

Differential Revision: D18609445

fbshipit-source-id: 5492fa92008cb33e1122b72b48d0858db0d5f994
This commit is contained in:
Jun Wu 2019-11-20 09:30:50 -08:00 committed by Facebook Github Bot
parent 31c07393a8
commit 9027d90624

View File

@ -256,6 +256,12 @@ def callcatch(ui, func):
return inst.code
except socket.error as inst:
ui.warn(_("%s\n") % inst.args[-1], error=_("abort"))
except Exception as e:
if type(e).__name__ == "TApplicationException":
ui.warn(_("ThriftError: %s\n") % e, error=_("abort"))
ui.warn(_("(try 'eden doctor' to diagnose this issue)\n"))
else:
raise
return -1