diff --git a/examples/python/cluster_example.py b/examples/python/cluster_example.py index 01f916963b..1d68544999 100644 --- a/examples/python/cluster_example.py +++ b/examples/python/cluster_example.py @@ -4,7 +4,7 @@ from glide import ( AllNodes, ClosingError, - ConnectionError, + ConnectionError as GlideConnectionError, GlideClusterClient, GlideClusterClientConfiguration, InfoSection, @@ -12,7 +12,7 @@ LogLevel, NodeAddress, RequestError, - TimeoutError, + TimeoutError as GlideTimeoutError, ) @@ -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 diff --git a/examples/python/ft_example.py b/examples/python/ft_example.py index b2163dc60f..7c74e0d742 100644 --- a/examples/python/ft_example.py +++ b/examples/python/ft_example.py @@ -10,7 +10,7 @@ from glide import ( AllNodes, ClosingError, - ConnectionError, + ConnectionError as GlideConnectionError, GlideClusterClient, GlideClusterClientConfiguration, InfoSection, @@ -18,7 +18,7 @@ LogLevel, NodeAddress, RequestError, - TimeoutError, + TimeoutError as GlideTimeoutError, ) from glide.async_commands.server_modules.ft_options.ft_create_options import ( @@ -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 diff --git a/examples/python/json_example.py b/examples/python/json_example.py index bc6e8d0786..bbf8eec171 100644 --- a/examples/python/json_example.py +++ b/examples/python/json_example.py @@ -6,7 +6,7 @@ from glide import ( AllNodes, ClosingError, - ConnectionError, + ConnectionError as GlideConnectionError, GlideClusterClient, GlideClusterClientConfiguration, InfoSection, @@ -14,7 +14,7 @@ LogLevel, NodeAddress, RequestError, - TimeoutError, + TimeoutError as GlideTimeoutError, ) @@ -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 diff --git a/examples/python/standalone_example.py b/examples/python/standalone_example.py index 60e2b62dbb..2191aec21a 100644 --- a/examples/python/standalone_example.py +++ b/examples/python/standalone_example.py @@ -3,14 +3,14 @@ from glide import ( ClosingError, - ConnectionError, + ConnectionError as GlideConnectionError, GlideClient, GlideClientConfiguration, Logger, LogLevel, NodeAddress, RequestError, - TimeoutError, + TimeoutError as GlideTimeoutError, ) @@ -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