| 1 | # This program is free software; you can redistribute it and/or modify it under |
|---|
| 2 | # the terms of the GNU General Public License as published by the Free Software |
|---|
| 3 | # Foundation; either version 2 of the License, or (at your option) any later |
|---|
| 4 | # version. |
|---|
| 5 | # |
|---|
| 6 | # This program is distributed in the hope that it will be useful, but WITHOUT |
|---|
| 7 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|---|
| 8 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
|---|
| 9 | # |
|---|
| 10 | # You should have received a copy of the GNU General Public License along with |
|---|
| 11 | # this program; if not, write to the Free Software Foundation, Inc., |
|---|
| 12 | # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|---|
| 13 | """this module contains exceptions used in the astng library |
|---|
| 14 | |
|---|
| 15 | :author: Sylvain Thenault |
|---|
| 16 | :copyright: 2003-2007 LOGILAB S.A. (Paris, FRANCE) |
|---|
| 17 | :contact: http://www.logilab.fr/ -- mailto:python-projects@logilab.org |
|---|
| 18 | :copyright: 2003-2007 Sylvain Thenault |
|---|
| 19 | :contact: mailto:thenault@gmail.com |
|---|
| 20 | """ |
|---|
| 21 | |
|---|
| 22 | __doctype__ = "restructuredtext en" |
|---|
| 23 | |
|---|
| 24 | class ASTNGError(Exception): |
|---|
| 25 | """base exception class for all astng related exceptions |
|---|
| 26 | """ |
|---|
| 27 | |
|---|
| 28 | class ASTNGBuildingException(ASTNGError): |
|---|
| 29 | """exception class when we are not able to build an astng representation""" |
|---|
| 30 | |
|---|
| 31 | class ResolveError(ASTNGError): |
|---|
| 32 | """base class of astng resolution/inference error""" |
|---|
| 33 | |
|---|
| 34 | class NotFoundError(ResolveError): |
|---|
| 35 | """raised when we are unabled to resolve a name""" |
|---|
| 36 | |
|---|
| 37 | class InferenceError(ResolveError): |
|---|
| 38 | """raised when we are unabled to infer a node""" |
|---|
| 39 | |
|---|
| 40 | class UnresolvableName(InferenceError): |
|---|
| 41 | """raised when we are unabled to resolve a name""" |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | class NoDefault(ASTNGError): |
|---|
| 45 | """raised by function's `default_value` method when an argument has |
|---|
| 46 | no default value |
|---|
| 47 | """ |
|---|
| 48 | |
|---|
| 49 | class IgnoreChild(Exception): |
|---|
| 50 | """exception that maybe raised by visit methods to avoid children traversal |
|---|
| 51 | """ |
|---|
| 52 | |
|---|