📄 exceptions.py
字号:
## Copyright (c) 2006, 2007 Canonical## Written by Gustavo Niemeyer <gustavo@niemeyer.net>## This file is part of Storm Object Relational Mapper.## Storm is free software; you can redistribute it and/or modify# it under the terms of the GNU Lesser General Public License as# published by the Free Software Foundation; either version 2.1 of# the License, or (at your option) any later version.## Storm is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU Lesser General Public License for more details.## You should have received a copy of the GNU Lesser General Public License# along with this program. If not, see <http://www.gnu.org/licenses/>.#class StormError(Exception): passclass CompileError(StormError): passclass NoTableError(CompileError): passclass ExprError(StormError): passclass NoneError(StormError): passclass PropertyPathError(StormError): passclass ClassInfoError(StormError): passclass URIError(StormError): passclass ClosedError(StormError): passclass FeatureError(StormError): pass class DatabaseModuleError(StormError): passclass StoreError(StormError): passclass NoStoreError(StormError): passclass WrongStoreError(StoreError): passclass NotFlushedError(StoreError): passclass OrderLoopError(StoreError): passclass NotOneError(StoreError): passclass UnorderedError(StoreError): passclass LostObjectError(StoreError): passclass Error(StormError): passclass Warning(StormError): passclass InterfaceError(Error): passclass DatabaseError(Error): passclass InternalError(DatabaseError): passclass OperationalError(DatabaseError): passclass ProgrammingError(DatabaseError): passclass IntegrityError(DatabaseError): passclass DataError(DatabaseError): passclass NotSupportedError(DatabaseError): passdef install_exceptions(module): for exception in (Error, Warning, DatabaseError, InternalError, OperationalError, ProgrammingError, IntegrityError, DataError, NotSupportedError): module_exception = getattr(module, exception.__name__, None) if module_exception is not None: module_exception.__bases__ += (exception,)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -