Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

fix: Cleanup logs when Firebase RTDB does no exist #76

Merged
merged 1 commit into from
Feb 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/googleclouddebugger/firebase_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,10 @@ def _RegisterDebuggee(self):

self.register_backoff.Succeeded()
return (False, 0) # Proceed immediately to subscribing to breakpoints.
except BaseException:
except BaseException as e:
# There is no significant benefit to handing different exceptions
# in different ways; we will log and retry regardless.
native.LogInfo(f'Failed to register debuggee: {traceback.format_exc()}')
native.LogInfo(f'Failed to register debuggee: {repr(e)}')
return (True, self.register_backoff.Failed())

def _CheckDebuggeePresence(self):
Expand All @@ -394,9 +394,8 @@ def _CheckDebuggeePresence(self):
snapshot = firebase_admin.db.reference(path).get()
# The value doesn't matter; just return true if there's any value.
return snapshot is not None
except BaseException:
native.LogInfo(
f'Failed to check debuggee presence: {traceback.format_exc()}')
except BaseException as e:
native.LogInfo(f'Failed to check debuggee presence at {path}: {repr(e)}')
return False

def _MarkDebuggeeActive(self):
Expand Down