Skip to content

Commit

Permalink
chore: adapt for whitelist limit error
Browse files Browse the repository at this point in the history
  • Loading branch information
abaicus committed Dec 6, 2024
1 parent 160f394 commit 38be47d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions inc/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ public function request( $path, $method = 'GET', $params = [], $extra_headers =
return 'disconnect';
}

if ( $path === '/optml/v2/account/details'
&& isset( $response['error'] ) && $response['error'] === 'whitelist_limit_reached' ) {
return 'disconnect';
}

return isset( $response['error'] ) ? new WP_Error(
'api_error',
wp_kses(
Expand Down

0 comments on commit 38be47d

Please sign in to comment.