Skip to content

Commit

Permalink
Added GolessException, it base classes other errors, and they are exp…
Browse files Browse the repository at this point in the history
…osed to package-level.
  • Loading branch information
rgalanakis committed Jul 11, 2014
1 parent 93bcc02 commit 75c02dd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion goless/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import sys
import traceback

from .backends import current as _be
from .backends import current as _be, Deadlock, GolessException

# noinspection PyUnresolvedReferences
from .channels import chan, ChannelClosed
Expand Down
6 changes: 5 additions & 1 deletion goless/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
import sys


class Deadlock(Exception):
class GolessException(Exception):
pass


class Deadlock(GolessException):
def __init__(self, msg):
Exception.__init__(self, msg)

Expand Down
4 changes: 2 additions & 2 deletions goless/channels.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import collections as _collections

from .backends import current as _be
from .backends import current as _be, GolessException as _GolessException
from .compat import range, maxint, PY3


class ChannelClosed(Exception):
class ChannelClosed(_GolessException):
"""
Exception raised to indicate a channel is closing or has closed.
"""
Expand Down

0 comments on commit 75c02dd

Please sign in to comment.