Skip to content

Commit

Permalink
Fixed imported exception names in python examples (#2852)
Browse files Browse the repository at this point in the history
fixed exception names in python examples

Signed-off-by: lior sventitzky <[email protected]>
  • Loading branch information
liorsve authored Dec 25, 2024
1 parent 9767ead commit 994455a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions examples/python/cluster_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
from glide import (
AllNodes,
ClosingError,
ConnectionError,
ConnectionError as GlideConnectionError,
GlideClusterClient,
GlideClusterClientConfiguration,
InfoSection,
Logger,
LogLevel,
NodeAddress,
RequestError,
TimeoutError,
TimeoutError as GlideTimeoutError,
)


Expand Down Expand Up @@ -101,11 +101,11 @@ async def exec_app_logic():
f"Client has closed and needs to be re-created: {e}",
)
raise e
except TimeoutError as e:
except GlideTimeoutError as e:
# A request timed out. You may choose to retry the execution based on your application's logic
Logger.log(LogLevel.ERROR, "glide", f"TimeoutError encountered: {e}")
raise e
except ConnectionError as e:
except GlideConnectionError as e:
# The client wasn't able to reestablish the connection within the given retries
Logger.log(LogLevel.ERROR, "glide", f"ConnectionError encountered: {e}")
raise e
Expand Down
8 changes: 4 additions & 4 deletions examples/python/ft_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
from glide import (
AllNodes,
ClosingError,
ConnectionError,
ConnectionError as GlideConnectionError,
GlideClusterClient,
GlideClusterClientConfiguration,
InfoSection,
Logger,
LogLevel,
NodeAddress,
RequestError,
TimeoutError,
TimeoutError as GlideTimeoutError,
)

from glide.async_commands.server_modules.ft_options.ft_create_options import (
Expand Down Expand Up @@ -141,11 +141,11 @@ async def exec_app_logic():
f"Client has closed and needs to be re-created: {e}",
)
raise e
except TimeoutError as e:
except GlideTimeoutError as e:
# A request timed out. You may choose to retry the execution based on your application's logic
Logger.log(LogLevel.ERROR, "glide", f"TimeoutError encountered: {e}")
raise e
except ConnectionError as e:
except GlideConnectionError as e:
# The client wasn't able to reestablish the connection within the given retries
Logger.log(LogLevel.ERROR, "glide", f"ConnectionError encountered: {e}")
raise e
Expand Down
8 changes: 4 additions & 4 deletions examples/python/json_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
from glide import (
AllNodes,
ClosingError,
ConnectionError,
ConnectionError as GlideConnectionError,
GlideClusterClient,
GlideClusterClientConfiguration,
InfoSection,
Logger,
LogLevel,
NodeAddress,
RequestError,
TimeoutError,
TimeoutError as GlideTimeoutError,
)


Expand Down Expand Up @@ -91,11 +91,11 @@ async def exec_app_logic():
f"Client has closed and needs to be re-created: {e}",
)
raise e
except TimeoutError as e:
except GlideTimeoutError as e:
# A request timed out. You may choose to retry the execution based on your application's logic
Logger.log(LogLevel.ERROR, "glide", f"TimeoutError encountered: {e}")
raise e
except ConnectionError as e:
except GlideConnectionError as e:
# The client wasn't able to reestablish the connection within the given retries
Logger.log(LogLevel.ERROR, "glide", f"ConnectionError encountered: {e}")
raise e
Expand Down
8 changes: 4 additions & 4 deletions examples/python/standalone_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

from glide import (
ClosingError,
ConnectionError,
ConnectionError as GlideConnectionError,
GlideClient,
GlideClientConfiguration,
Logger,
LogLevel,
NodeAddress,
RequestError,
TimeoutError,
TimeoutError as GlideTimeoutError,
)


Expand Down Expand Up @@ -91,11 +91,11 @@ async def exec_app_logic():
"glide",
f"Client has closed and needs to be re-created: {e}",
)
except TimeoutError as e:
except GlideTimeoutError as e:
# A request timed out. You may choose to retry the execution based on your application's logic
Logger.log(LogLevel.ERROR, "glide", f"TimeoutError encountered: {e}")
raise e
except ConnectionError as e:
except GlideConnectionError as e:
# The client wasn't able to reestablish the connection within the given retries
Logger.log(LogLevel.ERROR, "glide", f"ConnectionError encountered: {e}")
raise e
Expand Down

0 comments on commit 994455a

Please sign in to comment.