Skip to content

Commit

Permalink
Merge pull request #58 from openziti/raise-proper-errors
Browse files Browse the repository at this point in the history
ziti.accept should raise BlockingIOError(OS error EWOULDBLOCK/EAGAIN)…
  • Loading branch information
ekoby authored Nov 2, 2023
2 parents 6f436f3 + 544bed3 commit a9f486d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ tag_prefix = v
parentdir_prefix = openziti-

[openziti]
ziti_sdk_version = 0.35.1
ziti_sdk_version = 0.35.4
10 changes: 7 additions & 3 deletions src/openziti/zitilib.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,13 @@ def check_error(code):
err = _ziti_lasterr()
if err < 0:
msg = _ziti_errorstr(err).decode(encoding='utf-8')
else:
msg = errorstr(err)
raise Exception(err, msg)
raise Exception(err, msg)

if err in [socket.EWOULDBLOCK, socket.EAGAIN]:
raise BlockingIOError()

msg = os.strerror(err)
raise OSError(err, msg)


def init():
Expand Down

0 comments on commit a9f486d

Please sign in to comment.