Add better error logging (#15383)
This commit is contained in:
1 parent
e38705c3e8
commit
06231ec299
1 file changed
+4
-2
@@ -12,12 +12,14 @@ export function getTokenObjectFromCredential(credential: CredentialPayload) {
|
||||
"GoogleCalendarService-getTokenObjectFromCredential",
|
||||
safeStringify(parsedTokenResponse.error.issues)
|
||||
);
|
||||
throw new Error("Could not parse credential.key");
|
||||
throw new Error(
|
||||
`Could not parse credential.key ${credential.id} with error: ${parsedTokenResponse?.error}`
|
||||
);
|
||||
}
|
||||
|
||||
const tokenResponse = parsedTokenResponse.data;
|
||||
if (!tokenResponse) {
|
||||
throw new Error("credential.key is not set");
|
||||
throw new Error(`credential.key is not set for credential ${credential.id}`);
|
||||
}
|
||||
|
||||
return tokenResponse;
|
||||
|
||||
Reference in new issue
Block a user