Did I find the right examples for you? yes no

All Samples(157106)  |  Call(84368)  |  Derive(72707)  |  Import(31)
Common base class for all non-exit exceptions.

src/h/u/hunch-sample-app-HEAD/app/utils.py   hunch-sample-app(Download)
        return simplejson.loads(content)
    except simplejson.JSONDecodeError, e:
        raise Exception('JSONDecodeError', url, content, e)
def sign_request(dict_object):

src/a/u/AutobahnPython-HEAD/examples/twisted/wamp1/rpc/simple/example2/server.py   AutobahnPython(Download)
   def square(self, x):
      MAX = 1000
      if x > MAX:
         ## raise a custom exception
         raise Exception("http://example.com/error#number_too_big",
      if len(errs) > 0:
         raise Exception("http://example.com/error#invalid_numbers",
                         "one or more numbers are multiples of 3",

src/g/d/GDAL-1.10.0/samples/densify.py   GDAL(Download)
    def open(self):
        if self.options.input:
            self.in_ds = ogr.Open(self.options.input)
            raise Exception("No input layer was specified")
        if self.options.layer:
            self.input = self.in_ds.GetLayerByName(self.options.layer)
            if not self.input:
                raise Exception("The layer '%s' was not found" % self.options.layer)
        if not self.out_drv:
            raise Exception("The '%s' driver was not found, did you misspell it or is it not available in this GDAL build?", self.options.driver)
        if not self.out_drv.TestCapability( 'CreateDataSource' ):
            raise Exception("The '%s' driver does not support creating layers, you will have to choose another output driver", self.options.driver)
        if not self.options.output:
            raise Exception("No output layer was specified")

src/d/j/django-stripe-example-HEAD/sales/models.py   django-stripe-example(Download)
        if self.charge_id: # don't let this be charged twice!
            return False, Exception(message="Already charged.")

src/m/a/main-HEAD/Runtime/Samples/sympl/python/parser.py   main(Download)
    res = None
    if token is lexer.SyntaxToken.EOF:
        raise Exception("Unexpected EOF encountered while parsing expression.")
    if token is lexer.SyntaxToken.Quote:
            token not in [lexer.KeywordToken.Nil, lexer.KeywordToken.True,
            raise Exception("Keyword cannot be an expression: " + 
            return res
    raise Exception("Unexpected token when expecting "+ 
                    "beginning of expression -- " + str(token) + " ... " +
                    repr([lexr.GetToken(), lexr.GetToken(),
def _parseForm (lexr):
    debugprint("IN parseform:")
    token = lexr.GetToken()
    if token is not lexer.SyntaxToken.Paren:
        raise Exception("List expression must start with '('.")
def _parseKeywordForm (lexr):
    debugprint("IN parse kwd form:")
    name = lexr.GetToken()
    if not isinstance(name, lexer.KeywordToken):
        raise Exception("Internal error: parsing keyword form?")

src/m/a/main-HEAD/Runtime/Samples/sympl/python/etgen.py   main(Download)
        return AnalyzeUnaryExpr(expr, scope)
        raise Exception("Internal: no expression to analyze -- " +
def AnalyzeImportExpr (expr, scope):
    debugprint("analyze import ...")
    if type(expr) is not parser.SymplImportExpr:
        raise Exception("Internal: need import expr to analyze.")
    if not scope.IsModule():
        raise Exception("Import expression must be a top level expression.")
def AnalyzeDefunExpr (expr, scope):
    debugprint("analyze defun ...", expr.Name.Name)
    if type(expr) is not parser.SymplDefunExpr:
        raise Exception("Internal: need defun to analyze.")
    if not scope.IsModule():
        raise Exception("Use Defmethod or Lambda when not defining " +

src/h/a/hakmatak-1.1.2/hakmatak/store/read/example/basic.py   hakmatak(Download)
    def _get_meta_level1_leaf(self,leafName):
        if not SIMPLE_TREE.has_key(leafName):
            raise Exception("Unknown leaf %s at level 1" % leafName)
        d = SIMPLE_TREE[leafName]
    def _get_data_level1_leaf(self,leafName):
        if not SIMPLE_TREE.has_key(leafName):
            raise Exception("Unknown leaf %s at level 1" % leafName)
        d = SIMPLE_TREE[leafName]
    def _get_meta_level1_node(self,nodeName):
        if not SIMPLE_TREE.has_key(nodeName):
            raise Exception("Unknown node %s at level 1" % nodeName)
        d = SIMPLE_TREE[nodeName]
    def _get_meta_level2_leaf(self,parentNode,leafName):
        if not SIMPLE_TREE.has_key(parentNode):
            raise Exception("Unknown node %s at level 1" % parentNode)
        d = SIMPLE_TREE[parentNode]
        if not d.has_key(leafName):
            raise Exception("Unknown leaf %s at level 2" % leafName)

src/m/a/main-HEAD/Runtime/Samples/sympl/python/lexer.py   main(Download)
            return SyntaxToken.Dot
        raise Exception("Internal: couldn't get token? -- char[" + 
                        str(ch) + "]")
    def _getIdOrNumber (self):
        ch = self._getChar()
        if ch is SyntaxToken.EOF or ch != '-':
            raise Exception("Internal: parsing ID or number without hyphen.")
        ch = self._peekChar()
        first = first or self._getChar()
        if first is SyntaxToken.EOF or not self._startsId(first):
            raise Exception("Internal: getting Id or keyword?")
        if first == '\\':
            quotedId = True
            res = self._getChar()
            if res is SyntaxToken.EOF:
                raise Exception("Unexpected EOF when getting Id.")
            if not self._startsId(first):
                raise Exception("Don't support quoted Ids that have " +

src/m/a/main-HEAD/Runtime/Samples/sympl/python/runtime.py   main(Download)
                    value = runtime.ExecuteFile(f)
                    raise Exception("Import: can't find name in globals " +
                                    "or as file to load -- " + name + ", " +
            return lst
            raise Exception("List doesn't have " + repr(i) + " elements.")
def MakeSymplImportCall (runtime, module, what, names, renames):
    if not isinstance(names, list):
        raise Exception("Internal: name is not list?")
    return Exprs.Expression.Dynamic(
def GetRuntimeTypeMoFromModel (typeMO):
    if type(typeMO) is not TypeModelMetaObject:
        raise Exception("Internal: Need TMMO to fish out ReflType.")
    return DynamicMetaObject(
               ## In C# can use Expression.Call on methodinfo.
            (isinstance(members[0], refl.PropertyInfo) or
             isinstance(members[0], refl.FieldInfo))):
            raise Exception("Haven't implemented invoking delegate values " +
                            "from properties or fields.")
            ## NOT TESTED, should check type for isinstance delegate

src/a/p/apptools-4.2.1/examples/permissions/server/server.py   apptools(Download)
        except Exception, e:
            logger.error("Unable to sync:" % e)
            Exception("An error occurred on the permissions server.")
    def _session_data(self, key):
            raise Exception("Your session has timed out. Please login again.")
        # Update when the session was last used.
        if session_name != name:
            raise Exception("You do not have the appropriate authority.")
        return perm_ids
        if perm_id not in perm_ids:
            raise Exception("You do not have the appropriate authority.")
    def _check_policy_authorisation(self, key):
        if self._local_user_db:
            if self._users.has_key(name):
                raise Exception("The user \"%s\" already exists." % name)
            self._users[name] = (description, password)

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next