Add better error logging (#15383)
This commit is contained in:
@@ -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