Skip to content

Commit

Permalink
Update some formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
olijeffers0n committed Jun 7, 2023
1 parent d8067bd commit 850d73d
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions rustplus/api/remote/rustws.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,25 +82,23 @@ async def connect(
self.connection = await connect(address, close_timeout=0, ping_interval=None)
self.connected_time = time.time()

try:
if self.on_success is not None:
if self.on_success is not None:
try:
if asyncio.iscoroutinefunction(self.on_success):
await self.on_success()
else:
self.on_success()

except Exception as e:
self.logger.warning(e)

except Exception as e:
self.logger.warning(e)
break

except Exception as exception:
print_error = True

if not isinstance(exception, KeyboardInterrupt):
# Run the failure callback
try:
if self.on_failure is not None:
if self.on_failure is not None:
try:
if asyncio.iscoroutinefunction(self.on_failure):
val = await self.on_failure()
else:
Expand All @@ -109,8 +107,8 @@ async def connect(
if val is not None:
print_error = val

except Exception as e:
self.logger.warning(e)
except Exception as e:
self.logger.warning(e)

if print_error:
self.logger.warning(
Expand Down

0 comments on commit 850d73d

Please sign in to comment.