Skip to content

Commit

Permalink
Merge pull request #862 from Codeinwp/feat/whitelist-hard-limit
Browse files Browse the repository at this point in the history
chore: adapt for whitelist limit error
  • Loading branch information
abaicus authored Feb 21, 2025
2 parents 9ad0a81 + 38be47d commit da83113
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 da83113

Please sign in to comment.