2020-07-05 08:58:23 +02:00
|
|
|
"""
|
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):
|
|
|
|
"""Base class for gaimbio exceptions"""
|
2020-07-13 22:02:31 +02:00
|
|
|
|
2020-03-19 18:24:06 +01:00
|
|
|
pass
|
|
|
|
|
2020-03-19 19:48:24 +01:00
|
|
|
|
|
|
|
class AlreadyJoinedError(GiambioError):
|
|
|
|
pass
|
2020-03-20 11:27:26 +01:00
|
|
|
|
|
|
|
|
2020-03-25 18:37:57 +01:00
|
|
|
class CancelledError(BaseException):
|
2020-11-14 10:42:46 +01:00
|
|
|
"""Exception raised by the giambio._layers.Task.cancel() method"""
|
2020-03-23 18:52:17 +01:00
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
return "giambio.exceptions.CancelledError"
|
2020-07-05 08:58:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ResourceBusy(GiambioError):
|
|
|
|
"""Exception that is raised when a resource is accessed by more than
|
2020-11-12 23:10:54 +01:00
|
|
|
one task at a time"""
|
2020-07-13 22:02:31 +02:00
|
|
|
|
2020-07-05 08:58:23 +02:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class BrokenPipeError(GiambioError):
|
|
|
|
"""Wrapper around the broken pipe socket.error"""
|
2020-07-13 22:02:31 +02:00
|
|
|
|
2020-07-05 08:58:23 +02:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class ResourceClosed(GiambioError):
|
|
|
|
"""Raised when I/O is attempted on a closed fd"""
|
2020-07-13 22:02:31 +02:00
|
|
|
|
2020-07-05 08:58:23 +02:00
|
|
|
pass
|