tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

errors.py (1181B)


      1 # This Source Code Form is subject to the terms of the Mozilla Public
      2 # License, v. 2.0. If a copy of the MPL was not distributed with this,
      3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
      4 
      5 
      6 class MissingVCSTool(Exception):
      7    """Represents a failure to find a version control tool binary."""
      8 
      9 
     10 class MissingVCSInfo(Exception):
     11    """Represents a general failure to resolve a VCS interface."""
     12 
     13 
     14 class MissingConfigureInfo(MissingVCSInfo):
     15    """Represents error finding VCS info from configure data."""
     16 
     17 
     18 class MissingVCSExtension(MissingVCSInfo):
     19    """Represents error finding a required VCS extension."""
     20 
     21    def __init__(self, ext):
     22        self.ext = ext
     23        msg = f"Could not detect required extension '{self.ext}'"
     24        super().__init__(msg)
     25 
     26 
     27 class InvalidRepoPath(Exception):
     28    """Represents a failure to find a VCS repo at a specified path."""
     29 
     30 
     31 class MissingUpstreamRepo(Exception):
     32    """Represents a failure to automatically detect an upstream repo."""
     33 
     34 
     35 class CannotDeleteFromRootOfRepositoryException(Exception):
     36    """Represents that the code attempted to delete all files from the root of
     37    the repository, which is not permitted."""