def __init__(self, status, msg):
        supermsg = 'Memcached error #' + repr(status)
        if msg:
            supermsg += ":  " + msg
        Exception.__init__(self, supermsg)

        self.status = status
        self.msg = msg
Beispiel #2
0
 def __init__(self, error, status, code=400, headers=None):
     Exception.__init__(self)
     if not isinstance(error, list):
         self.errors = [str(error)]
     else:
         self.errors = error
     self.code = code
     self.status = status
     self.headers = headers
 def __init__(self, error_code, attach_value=''):
     attach_value = '' if attach_value == '' else ' (定位值:%s)' % attach_value
     obj = t_sys_error_code.objects.filter(error_code=error_code)
     if obj.count() > 0:
         err = obj[0].error_text + attach_value
         Exception.__init__(self, err)
         self.todo = obj[0].possible_reason
     else:
         err = u'未知异常::>_<:: ' + attach_value
         Exception.__init__(self, err)
         self.todo = u'请维护error_code:%s' % error_code
Beispiel #4
0
    def __init__(self, message, traceback=None):
        """
        Constructor

        :type message: str
        :param message: Exception explanations

        :type traceback: str
        :param traceback: String representation of exception traceback.
        """
        Exception.__init__(self, message)
        self.__traceback = traceback
    def __init__(self, generic_error_msg, specific_msg=None):
        """
        Initializes this instance.

        :type generic_error_msg: str
        :param generic_error_msg: this object's generic error message.
        :type specific_msg: str
        :param specific_msg: specific additional error message.
            Optional parameter, defaults to C{None}.
        """
        Exception.__init__(self)
        self.__generic_error_msg = generic_error_msg
        self.__specific_msg = specific_msg

        self._error_code = None
        self._error_msg = self.get_error_message()
Beispiel #6
0
  def __init__(self, **kwargs):
    """
    DBS exception can be initialized in following ways:
      DBSException(args=exceptionString)
      DBSException(exception=exceptionObject)      
    """ 
    args = kwargs.get("args", "")
    ex = kwargs.get("exception", None)
    if ex != None:
      if isinstance(ex, Exception):
	 exArgs = "%s" % (ex)
	 if args == "":
	   args = exArgs
	 else:
	   args = "%s (%s)" % (args, exArgs)
    Exception.__init__(self, args)
Beispiel #7
0
    def __init__(self, **kwargs):
        """
    DBS exception can be initialized in following ways:
      DBSException(args=exceptionString)
      DBSException(exception=exceptionObject)      
    """

        args = kwargs.get("args", "")
        ex = kwargs.get("exception", None)
        self.code = kwargs.get("code", "")

        if ex != None:
            if isinstance(ex, Exception):
                exArgs = "%s" % (ex)
                if args == "":
                    args = exArgs
                else:
                    args = "%s (%s)" % (args, exArgs)
        #print args
        Exception.__init__(self, args)
Beispiel #8
0
 def __init__(self, rv, *args):
     self.rv = rv
     Exc.__init__(self, *args)
Beispiel #9
0
 def __init__(self, mixture):
     self.mixture = mixture
     Exception.__init__(self)
	def __init__(self, message):
		""" Initialize module """
		Exception.__init__(self)
		self.message = message
	def __init__(self, msg):
		Exception.__init__(self, msg)
Beispiel #12
0
 def __init__(self, extent):
     Exception.__init__(self)
     self.message = "Could not use: {0} as extent".format(extent)
Beispiel #13
0
 def __init__(self, sofar, numpreds, succs):
     Exception.__init__(self, "cycle in constraints", sofar, numpreds, succs)
     self.preds = None
Beispiel #14
0
 def __init__(self, filename):
   Exception.__init__(self, 'square bracket not match "%s"' % filename)
Beispiel #15
0
 def __init__(self, filename):
   Exception.__init__(self, 'round bracket not match, "%s"' % filename)
Beispiel #16
0
 def __init__(self, name, referer=None):
   if referer != None:
     Exception.__init__(self, 'Module not found "%s", referer "%s"' %
         (name, referer))
   else:
     Exception.__init__(self, 'Module not found "%s"' % name)
Beispiel #17
0
 def __init__(self, message, processdict=None):
     Exception.__init__(self, message)
     self.classname = "Spotfinder Problem"
     self.parameters = processdict
Beispiel #18
0
 def __init__(self, msg, *args, **kwargs):
     Exception.__init__(self, *args, **kwargs)
     self.msg = msg
Beispiel #19
0
 def __init__(self, sofar, numpreds, succs):
     Exception.__init__(self, "cycle in constraints", sofar, numpreds,
                        succs)
     self.preds = None
Beispiel #20
0
 def __init__(msg):
     Exception.__init__(msg)
Beispiel #21
0
 def __init__(self, filename):
   Exception.__init__(self, 'curly bracket not match "%s"' % filename)
Beispiel #22
0
 def __init__(self,mixture):
     self.mixture = mixture
     Exception.__init__(self)
Beispiel #23
0
 def __init__(self, path):
   Exception.__init__(self, 'Path not found, %s', path)
Beispiel #24
0
 def __init__(self, err='Natrix BaseException'):
     Exception.__init__(self, err)
Beispiel #25
0
 def __init__(self, layers, behavior, trim):
     Exception.__init__(self)
     self.message = (
         "Could not create a spatial finder with layers: {0}, "
         "behavior {1} and trim value {2}").format(layers, behavior, trim)
Beispiel #26
0
 def __init__(self, message, status_code):
     Exception.__init__(self)
     self.message = message
     self.status_code = status_code
 def __init__(self, message):
     """ Initialize module """
     Exception.__init__(self)
     self.message = message
 def __init__(self, message, innerException=None):
     Exception.__init__(self)
     self.message = message
     self.innerException = innerException
Beispiel #29
0
 def __init__(self, struct, varname):
     self.struct = struct
     self.varname = varname
     Exception.__init__(self)
Beispiel #30
0
 def __init__(self, msg, widget = None):
   Exception.__init__(self, msg)
   self.widget = widget
Beispiel #31
0
 def __init__(self, insee_code, year):
     message = "The commune with insee code %s was removed in %s"%(insee_code, year)
     Exception.__init__(self, message)
 def __init__(self, message, innerException = None):
     Exception.__init__(self)
     self.message = message
     self.innerException = innerException
Beispiel #33
0
 def __init__(self, insee_code):
     message = "This commune with insee code %s has not been imported yet"%(insee_code)
     Exception.__init__(self, message)
Beispiel #34
0
 def __init__(self, old_insee_code, new_insee_code):
     message = "Insee code of this commune was change from %s to %s"%(old_insee_code, new_insee_code)
     Exception.__init__(self, message)
Beispiel #35
0
 def __init__(self, *args, **keywords):
     Exception.__init__(self, *args)
     self.keywords = keywords
     self._print_exc_str = None
Beispiel #36
0
    def __init__(self, msg, variableValue):
        Exception.__init__(self, msg)

        self.variableValue = variableValue
Beispiel #37
0
 def __init__(self):
     Exception.__init__(self)
Beispiel #38
0
 def __init__(msg):
     Exception.__init__(msg)
Beispiel #39
0
 def __init__(self, errStr = ''):
     Exception.__init__(self)
     self.errStr = errStr
Beispiel #40
0
 def __init__(self, value=None):
     Exception.__init__(self)
     self.value = value
Beispiel #41
0
 def __init__(self,message,processdict=None):
   Exception.__init__(self,message)
   self.classname="Spotfinder Problem"
   self.parameters = processdict
Beispiel #42
0
 def __init__(self, msg):
     Exception.__init__(self, msg)
Beispiel #43
0
    def __init__(self, msg, variableValue):
        Exception.__init__(self, msg)

        self.variableValue = variableValue
Beispiel #44
0
 def __init__(self,struct,varname):
     self.struct = struct
     self.varname = varname
     Exception.__init__(self)
	def __init__(self, message):
		Exception.__init__(self)
		self.message = message
Beispiel #46
0
 def __init__(self, msg, *args, **kwargs):
     Exception.__init__(self, *args, **kwargs)
     self.msg = msg
Beispiel #47
0
 def __init__(self, a_behavior):
     Exception.__init__(self)
     self.message = "Could not instantiate behavior {0}".format(a_behavior)