exceptions.py :  » Web-Frameworks » Spyce » spyce-2.1 » sqlalchemy » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Web Frameworks » Spyce 
Spyce » spyce 2.1 » sqlalchemy » exceptions.py
# exceptions.py - exceptions for SQLAlchemy
# Copyright (C) 2005,2006 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php


class SQLAlchemyError(Exception):
    """generic error class"""
    pass
    
class SQLError(SQLAlchemyError):
    """raised when the execution of a SQL statement fails.  includes accessors
    for the underlying exception, as well as the SQL and bind parameters"""
    def __init__(self, statement, params, orig):
        SQLAlchemyError.__init__(self, "(%s) %s"% (orig.__class__.__name__, str(orig)))
        self.statement = statement
        self.params = params
        self.orig = orig
    def __str__(self):
        return SQLAlchemyError.__str__(self) + " " + repr(self.statement) + " " + repr(self.params)

class ArgumentError(SQLAlchemyError):
    """raised for all those conditions where invalid arguments are sent to constructed
    objects.  This error generally corresponds to construction time state errors."""
    pass

class TimeoutError(SQLAlchemyError):
    """raised when a connection pool times out on getting a connection"""
    pass

class ConcurrentModificationError(SQLAlchemyError):
    """raised when a concurrent modification condition is detected"""
    pass
        
class FlushError(SQLAlchemyError):
    """raised when an invalid condition is detected upon a flush()"""
    pass
    
class InvalidRequestError(SQLAlchemyError):
    """sqlalchemy was asked to do something it cant do, return nonexistent data, etc.
    This error generally corresponds to runtime state errors."""
    pass

class NoSuchTableError(InvalidRequestError):
    """sqlalchemy was asked to load a table's definition from the database,
    but the table doesn't exist."""
    pass

class AssertionError(SQLAlchemyError):
    """corresponds to internal state being detected in an invalid state"""
    pass

class NoSuchColumnError(KeyError, SQLAlchemyError):
    """raised by RowProxy when a nonexistent column is requested from a row"""
    pass
        
class DBAPIError(SQLAlchemyError):
    """something weird happened with a particular DBAPI version"""
    def __init__(self, message, orig):
        SQLAlchemyError.__init__(self, "(%s) (%s) %s"% (message, orig.__class__.__name__, str(orig)))
        self.orig = orig
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.