amzn / amazon-advertising-api-php-sdk

⛔️ DEPRECATED - Amazon Advertising API PHP Client Library
Apache License 2.0
93 stars 67 forks source link

Return error response with exception #5

Closed callcolor closed 6 years ago

callcolor commented 6 years ago

Return $response with exception rather than returning 1 and echoing $response to console.

Current: print_r() echo Array ( [success] => [code] => 400 [response] => {"error_description":"Not authorized for requested operation","error":"unauthorized_client"} [requestId] => 0 ) $e->getMessage() Unable to refresh token. 'access_token' not found in response. 1

Expected: $e->getMessage() Unable to refresh token. 'access_token' not found in response. Array ( [success] => [code] => 400 [response] => {"error_description":"Not authorized for requested operation","error":"unauthorized_client"} [requestId] => 0 )

dbrent-amazon commented 6 years ago

Thanks!