Files
@ 4ae4989cb7e7
Branch filter:
Location: rattail-project/rattail/rattail/exceptions.py
4ae4989cb7e7
2.9 KiB
text/x-python
Tweaked Fabric `release` command.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2012 Lance Edgar
#
# This file is part of Rattail.
#
# Rattail is free software: you can redistribute it and/or modify it under the
# terms of the GNU Affero General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# Rattail 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 Affero General Public License for
# more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Rattail. If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
"""
``rattail.exceptions`` -- Exceptions
"""
class RattailError(Exception):
"""
Base class for all Rattail exceptions.
"""
class BatchError(RattailError):
"""
Base class for all batch-related errors.
"""
class BatchTypeNotFound(BatchError):
def __init__(self, name):
self.name = name
def __str__(self):
return "Batch type not found: %s" % self.name
class BatchTypeNotSupported(BatchError):
"""
Raised when a :class:`rattail.db.batches.BatchExecutor` instance is asked
to execute a batch, but the batch is of an unsupported type.
"""
def __init__(self, executor, batch_type):
self.executor = executor
self.batch_type = batch_type
def __str__(self):
return "Batch type '%s' is not supported by executor: %s" % (
self.batch_type, repr(self.executor))
class BatchExecutorNotFound(BatchError):
def __init__(self, name):
self.name = name
def __str__(self):
return "Batch executor not found: %s" % self.name
class LabelPrintingError(Exception):
pass
class PalmError(RattailError):
"""
Base class for all errors relating to the Palm OS application interface.
"""
class PalmClassicDatabaseTypelibNotFound(PalmError):
def __str__(self):
return ("The Python module for the Palm Classic Database type library "
"could not be generated. (Is the HotSync Manager software "
"installed?)")
class PalmConduitManagerNotFound(PalmError):
def __str__(self):
return ("The Palm Desktop Conduit Manager could not be instantiated. "
"(Is the HotSync Manager software installed?)")
class PalmConduitAlreadyRegistered(PalmError):
def __str__(self):
return "The Rattail Palm conduit is already registered."
class PalmConduitNotRegistered(PalmError):
def __str__(self):
return "The Rattail Palm conduit is not registered."
|