Skip to content

Commit

Permalink
improved error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
YannickFuereder committed Apr 5, 2024
1 parent 01d10bc commit 219a3cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion program/include/rcmail_oauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,8 @@ public function refresh_access_token(array $token)
'authorization' => $authorization,
];
} catch (RequestException $e) {
trigger_error($e->getRequest(), $e->getResponse(), E_USER_ERROR);

$this->last_error = 'OAuth refresh token request failed: ' . $e->getMessage();
$formatter = new MessageFormatter();
rcube::raise_error([
Expand Down Expand Up @@ -858,7 +860,7 @@ protected function parse_tokens($grant_type, &$data, $previous_data = null)
$this->log_debug('received tokens from a grant request %s: session: %s with scope %s, '
. 'access_token type %s exp in %ss, refresh_token exp in %ss, id_token present: %s, not-before-policy: %s',
$grant_type,
$data['session_state'], $data['scope'],
isset($data['session_state']), isset($data['scope']),
$data['token_type'], $data['expires_in'],
$data['refresh_expires_in'],
isset($data['id_token']),
Expand Down

0 comments on commit 219a3cb

Please sign in to comment.