From 36d0b83ed38e98103061665b2bf0413b0227dc0b Mon Sep 17 00:00:00 2001 From: Owen Date: Thu, 31 Jul 2025 15:00:17 -0700 Subject: [PATCH] Fix errors again --- server/routers/client/updateClient.ts | 7 +++++-- server/routers/gerbil/peers.ts | 10 ++++++++-- server/routers/gerbil/updateHolePunch.ts | 7 +++++-- server/routers/newt/handleGetConfigMessage.ts | 5 ++++- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/server/routers/client/updateClient.ts b/server/routers/client/updateClient.ts index 0fbb2a47..60a48732 100644 --- a/server/routers/client/updateClient.ts +++ b/server/routers/client/updateClient.ts @@ -342,10 +342,13 @@ export async function updateClient( } catch (error) { if (axios.isAxiosError(error)) { logger.error( - `Error updating destinations (can Pangolin see Gerbil HTTP API?) for exit node at ${destination.reachableAt} (status: ${error.response?.status}): ${error.message}` + `Error updating destinations (can Pangolin see Gerbil HTTP API?) for exit node at ${destination.reachableAt} (status: ${error.response?.status}): ${JSON.stringify(error.response?.data, null, 2)}` + ); + } else { + logger.error( + `Error updating destinations for exit node at ${destination.reachableAt}: ${error}` ); } - throw error; } } } diff --git a/server/routers/gerbil/peers.ts b/server/routers/gerbil/peers.ts index e62c7c8f..40203c41 100644 --- a/server/routers/gerbil/peers.ts +++ b/server/routers/gerbil/peers.ts @@ -44,8 +44,11 @@ export async function addPeer( logger.error( `Error adding peer (can Pangolin see Gerbil HTTP API?) for exit node at ${exitNode.reachableAt} (status: ${error.response?.status}): ${error.message}` ); + } else { + logger.error( + `Error adding peer for exit node at ${exitNode.reachableAt}: ${error}` + ); } - throw error; } } @@ -75,7 +78,10 @@ export async function deletePeer(exitNodeId: number, publicKey: string) { logger.error( `Error deleting peer (can Pangolin see Gerbil HTTP API?) for exit node at ${exitNode.reachableAt} (status: ${error.response?.status}): ${error.message}` ); + } else { + logger.error( + `Error deleting peer for exit node at ${exitNode.reachableAt}: ${error}` + ); } - throw error; } } diff --git a/server/routers/gerbil/updateHolePunch.ts b/server/routers/gerbil/updateHolePunch.ts index 74c4611b..bb7b53df 100644 --- a/server/routers/gerbil/updateHolePunch.ts +++ b/server/routers/gerbil/updateHolePunch.ts @@ -204,10 +204,13 @@ export async function updateHolePunch( } catch (error) { if (axios.isAxiosError(error)) { logger.error( - `Error updating destinations (can Pangolin see Gerbil HTTP API?) for exit node at ${destination.reachableAt} (status: ${error.response?.status}): ${error.message}` + `Error updating destinations (can Pangolin see Gerbil HTTP API?) for exit node at ${destination.reachableAt} (status: ${error.response?.status}): ${JSON.stringify(error.response?.data, null, 2)}` + ); + } else { + logger.error( + `Error updating destinations for exit node at ${destination.reachableAt}: ${error}` ); } - throw error; } } diff --git a/server/routers/newt/handleGetConfigMessage.ts b/server/routers/newt/handleGetConfigMessage.ts index 72e82e23..1059847c 100644 --- a/server/routers/newt/handleGetConfigMessage.ts +++ b/server/routers/newt/handleGetConfigMessage.ts @@ -131,8 +131,11 @@ export const handleGetConfigMessage: MessageHandler = async (context) => { logger.error( `Error updating proxy mapping (can Pangolin see Gerbil HTTP API?) for exit node at ${exitNode.reachableAt} (status: ${error.response?.status}): ${error.message}` ); + } else { + logger.error( + `Error updating proxy mapping for exit node at ${exitNode.reachableAt}: ${error}` + ); } - throw error; } } }