2020-07-05 08:58:23 +02:00
|
|
|
"""
|
2020-11-16 23:06:54 +01:00
|
|
|
Exceptions for giambio
|
|
|
|
|
2020-07-07 15:17:12 +02:00
|
|
|
Copyright (C) 2020 nocturn9x
|
2020-07-05 08:58:23 +02:00
|
|
|
|
2020-07-07 15:17:12 +02:00
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
2020-07-05 08:58:23 +02:00
|
|
|
|
2020-07-07 15:17:12 +02:00
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
2020-07-05 08:58:23 +02:00
|
|
|
|
2020-07-07 15:17:12 +02:00
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
2020-07-05 08:58:23 +02:00
|
|
|
"""
|
|
|
|
|
2020-07-13 22:02:31 +02:00
|
|
|
|
2020-03-19 18:24:06 +01:00
|
|
|
class GiambioError(Exception):
|
2020-11-16 23:06:54 +01:00
|
|
|
"""
|
|
|
|
Base class for giambio exceptions
|
|
|
|
"""
|
2020-03-19 19:48:24 +01:00
|
|
|
|
2020-11-16 23:06:54 +01:00
|
|
|
...
|
2020-03-20 11:27:26 +01:00
|
|
|
|
|
|
|
|
2020-11-17 10:06:35 +01:00
|
|
|
class InternalError(GiambioError):
|
|
|
|
"""
|
|
|
|
Internal exception
|
|
|
|
"""
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
|
2020-03-25 18:37:57 +01:00
|
|
|
class CancelledError(BaseException):
|
2020-11-16 23:06:54 +01:00
|
|
|
"""
|
|
|
|
Exception raised by the giambio.objects.Task.cancel() method
|
|
|
|
to terminate a child task. This should NOT be catched, or
|
|
|
|
at least it should be re-raised and never ignored
|
|
|
|
"""
|
2020-03-23 18:52:17 +01:00
|
|
|
|
2020-11-16 23:06:54 +01:00
|
|
|
...
|
2020-07-05 08:58:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ResourceBusy(GiambioError):
|
2020-11-16 23:06:54 +01:00
|
|
|
"""
|
|
|
|
Exception that is raised when a resource is accessed by more than
|
|
|
|
one task at a time
|
|
|
|
"""
|
2020-07-13 22:02:31 +02:00
|
|
|
|
2020-11-16 23:06:54 +01:00
|
|
|
...
|
2020-07-05 08:58:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ResourceClosed(GiambioError):
|
2020-11-16 23:06:54 +01:00
|
|
|
"""
|
|
|
|
Raised when I/O is attempted on a closed resource
|
|
|
|
"""
|
2020-07-13 22:02:31 +02:00
|
|
|
|
2020-11-16 23:06:54 +01:00
|
|
|
...
|