Plumbing for gmxapi 2019 Q1/Q2 project roadmap.
[gromacs.git] / python_packaging / src / gmxapi / exceptions.py
blobb2e334344a96d5d5ef14026120357c430c4b1047
1 # This file is part of the GROMACS molecular simulation package.
3 # Copyright (c) 2019, by the GROMACS development team, led by
4 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
5 # and including many others, as listed in the AUTHORS file in the
6 # top-level source directory and at http://www.gromacs.org.
8 # GROMACS is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU Lesser General Public License
10 # as published by the Free Software Foundation; either version 2.1
11 # of the License, or (at your option) any later version.
13 # GROMACS is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # Lesser General Public License for more details.
18 # You should have received a copy of the GNU Lesser General Public
19 # License along with GROMACS; if not, see
20 # http://www.gnu.org/licenses, or write to the Free Software Foundation,
21 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 # If you want to redistribute modifications to GROMACS, please
24 # consider that scientific software is very special. Version
25 # control is crucial - bugs must be traceable. We will be happy to
26 # consider code for inclusion in the official distribution, but
27 # derived work must not be called official GROMACS. Details are found
28 # in the README & COPYING files - if they are missing, get the
29 # official version at http://www.gromacs.org.
31 # To help us fund GROMACS development, we humbly ask that you cite
32 # the research papers on the package. Check out http://www.gromacs.org.
34 """
35 Exceptions and Warnings raised by gmxapi module operations
36 ==========================================================
38 Errors, warnings, and other exceptions used in the GROMACS
39 Python package are defined in the `exceptions` submodule.
41 The gmxapi Python package defines a root exception,
42 exceptions.Error, from which all Exceptions thrown from
43 within the module should derive. If a published component of
44 the gmxapi package throws an exception that cannot be caught
45 as a gmxapi.exceptions.Error, please report the bug.
46 """
48 __all__ = ['ApiError',
49 'Error',
50 'UsageError',
51 'ValueError',
52 'Warning'
56 class Error(Exception):
57 """Base exception for gmx.exceptions classes."""
60 class Warning(Warning):
61 """Base warning class for gmx.exceptions."""
64 class ApiError(Error):
65 """An API operation was attempted with an incompatible object."""
68 class UsageError(Error):
69 """Unsupported syntax or call signatures.
71 Generic usage error for gmxapi module.
72 """
75 class ValueError(Error):
76 """A user-provided value cannot be interpreted or doesn't make sense."""