Added exception handling to authorization process

This commit is contained in:
Justin Foell
2020-04-24 10:25:11 -05:00
parent 335ea74d07
commit 2fc9436b09
3 changed files with 12 additions and 6 deletions
+5 -1
View File
@@ -118,7 +118,11 @@ abstract class WPStrava_Auth {
$data = $this->add_initial_params( $data );
$strava_info = $this->token_request( $data );
try {
$strava_info = $this->token_request( $data );
} catch ( WPStrava_Exception $e ) {
wp_die( $e->to_html() ); // phpcs:ignore -- Debug only.
}
if ( isset( $strava_info->access_token ) ) {
$settings->add_id( $client_id );