Make error more clear

From #911
This commit is contained in:
Owen 2025-06-15 10:53:03 -04:00
parent b86ef93211
commit ddd292422b
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD

View file

@ -28,7 +28,7 @@ export async function addPeer(exitNodeId: number, peer: {
return response.data;
} catch (error) {
if (axios.isAxiosError(error)) {
throw new Error(`HTTP error! status: ${error.response?.status}`);
throw new Error(`Error communicating with Gerbil. Make sure Pangolin can reach the Gerbil HTTP API: ${error.response?.status}`);
}
throw error;
}
@ -48,7 +48,7 @@ export async function deletePeer(exitNodeId: number, publicKey: string) {
return response.data;
} catch (error) {
if (axios.isAxiosError(error)) {
throw new Error(`HTTP error! status: ${error.response?.status}`);
throw new Error(`Error communicating with Gerbil. Make sure Pangolin can reach the Gerbil HTTP API: ${error.response?.status}`);
}
throw error;
}