Skip to content

Commit

Permalink
breaking: Fix up exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrc52 committed Mar 11, 2023
1 parent 3d2f2f7 commit 5da0081
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions _moira.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,18 @@ cdef extern from "stdlib.h":
void free(void * ptr)

class MoiraException(Exception):
@property
def code(self):
return self.args[0]
code = property(code)
return self.args[0][0]

@property
def message(self):
return self.args[0][1]

__connected = False

def _error(code):
raise MoiraException((code, error_message(code)))
raise MoiraException((code, error_message(code).decode()))

def connect(server=''):
"""
Expand Down

0 comments on commit 5da0081

Please sign in to comment.