1# -*- coding: utf-8 -*-
2"""
3**********
4Exceptions
5**********
6
7Base exceptions and errors for NetworkX.
8
9"""
10__author__ = """Aric Hagberg (hagberg@lanl.gov)\nPieter Swart (swart@lanl.gov)\nDan Schult(dschult@colgate.edu)\nLoïc Séguin-C. <loicseguin@gmail.com>"""
11#    Copyright (C) 2004-2011 by
12#    Aric Hagberg <hagberg@lanl.gov>
13#    Dan Schult <dschult@colgate.edu>
14#    Pieter Swart <swart@lanl.gov>
15#    All rights reserved.
16#    BSD license.
17#
18
19# Exception handling
20
21# the root of all Exceptions
22class NetworkXException(Exception):
23    """Base class for exceptions in NetworkX."""
24
25class NetworkXError(NetworkXException):
26    """Exception for a serious error in NetworkX"""
27
28class NetworkXPointlessConcept(NetworkXException):
29    """Harary, F. and Read, R. "Is the Null Graph a Pointless Concept?"
30In Graphs and Combinatorics Conference, George Washington University.
31New York: Springer-Verlag, 1973.
32"""
33
34class NetworkXAlgorithmError(NetworkXException):
35    """Exception for unexpected termination of algorithms."""
36
37class NetworkXUnfeasible(NetworkXAlgorithmError):
38    """Exception raised by algorithms trying to solve a problem
39    instance that has no feasible solution."""
40
41class NetworkXNoPath(NetworkXUnfeasible):
42    """Exception for algorithms that should return a path when running
43    on graphs where such a path does not exist."""
44
45class NetworkXUnbounded(NetworkXAlgorithmError):
46    """Exception raised by algorithms trying to solve a maximization
47    or a minimization problem instance that is unbounded."""
48
49class NetworkXNotImplemented(NetworkXException):
50    """Exception raised by algorithms not implemented for a type of graph."""
51