Home | History | Annotate | Download | only in setools
      1 # Copyright 2015, Tresys Technology, LLC
      2 #
      3 # This file is part of SETools.
      4 #
      5 # SETools is free software: you can redistribute it and/or modify
      6 # it under the terms of the GNU Lesser General Public License as
      7 # published by the Free Software Foundation, either version 2.1 of
      8 # the License, or (at your option) any later version.
      9 #
     10 # SETools is distributed in the hope that it will be useful,
     11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13 # GNU Lesser General Public License for more details.
     14 #
     15 # You should have received a copy of the GNU Lesser General Public
     16 # License along with SETools.  If not, see
     17 # <http://www.gnu.org/licenses/>.
     18 #
     19 
     20 #
     21 # Base class for exceptions
     22 #
     23 
     24 
     25 class SEToolsException(Exception):
     26 
     27     """Base class for all SETools exceptions."""
     28     pass
     29 
     30 #
     31 # Permission map exceptions
     32 #
     33 
     34 
     35 class PermissionMapException(SEToolsException):
     36 
     37     """Base class for all permission map exceptions."""
     38     pass
     39 
     40 
     41 class PermissionMapParseError(PermissionMapException):
     42 
     43     """Exception for parse errors while reading permission map files."""
     44     pass
     45 
     46 
     47 class RuleTypeError(PermissionMapException):
     48 
     49     """Exception for using rules with incorrect rule type."""
     50     pass
     51 
     52 
     53 class UnmappedClass(PermissionMapException):
     54 
     55     """Exception for classes that are unmapped"""
     56     pass
     57 
     58 
     59 class UnmappedPermission(PermissionMapException):
     60 
     61     """Exception for permissions that are unmapped"""
     62     pass
     63