Skip to content

Commit

Permalink
Clean up bare excepts
Browse files Browse the repository at this point in the history
Signed-off-by: Flynn <[email protected]>
  • Loading branch information
kflynn committed Aug 10, 2024
1 parent 04f4d49 commit 60bf309
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion python/ambassador/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def process(self, resource: ACResource) -> RichStatus:

try:
handler(resource)
except Exception as e:
except Exception:
# Bzzzt.
raise
# return RichStatus.fromError("%s: could not process %s object: %s" % (resource, resource.kind, e))
Expand Down
2 changes: 1 addition & 1 deletion python/ambassador/diagnostics/envoy_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def update_envoy_stats(self, last_attempt: float) -> None:

try:
node[keypath[-1]] = int(value)
except:
except Exception:
continue

# Now dig into clusters a bit more.
Expand Down
2 changes: 1 addition & 1 deletion python/ambassador/fetch/ingress.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def _process(self, obj: KubernetesObject) -> None:

try:
service_port = int(service_port)
except:
except Exception:
service_port = self._try_resolve_service_port_number(
obj.namespace, service_name, service_port
)
Expand Down
4 changes: 2 additions & 2 deletions python/ambassador/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class SystemInfo:

try:
MyHostName = socket.gethostname()
except:
except Exception:
pass


Expand Down Expand Up @@ -1086,7 +1086,7 @@ def load_secret(

try:
serialization = open(source, "r").read()
except IOError as e:
except IOError:
self.logger.error(
"%s %s: FSSecretHandler could not open %s" % (resource.kind, resource.name, source)
)
Expand Down

0 comments on commit 60bf309

Please sign in to comment.