( )⚙ D5972 exchange: raise error.Abort instead of ValueError

This is an archive of the discontinued Mercurial Phabricator instance.

exchange: raise error.Abort instead of ValueError
ClosedPublic

Authored by indygreg on Feb 15 2019, 2:43 PM.

Details

Summary

Raising ValueError results in an uncaught exception and a traceback
being printed. In the context of servers, it can result in an HTTP
500 and an exception being logged in the error log.

I don't think this is proper behavior.

The bundle2 code paths have a mechanism for translating an
error.Abort into an error message reported to the clients. I
think we should use that instead.

This commit replaces some ValueError with Abort so that
servers can error more gracefully.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Feb 15 2019, 2:43 PM
This revision was automatically updated to reflect the committed changes.