Skip to content
Snippets Groups Projects
  • Gregory Szorc's avatar
    3b0ba457
    exchange: raise error.Abort instead of ValueError · 3b0ba457
    Gregory Szorc authored
    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.
    
    Differential Revision: https://phab.mercurial-scm.org/D5972
    3b0ba457
    History
    exchange: raise error.Abort instead of ValueError
    Gregory Szorc authored
    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.
    
    Differential Revision: https://phab.mercurial-scm.org/D5972