Closed Kalo79 closed 3 years ago
Hey @Kalo79 - yes, we will add this!
Here is how I'm doing it for now. It works for me.
else if ( $statusCode != 200 ) { $ret=$statusCode.' ('.$this->decodeJsonResponse( $response )['detail'].')'; throw new KlaviyoException( sprintf( self::ERROR_NON_200_STATUS, $ret ) ); }
In "handleResponse" an exception is thrown when the status code is !=200, but that exception only contains the status code and does not include any details from the response. The 400 status may be due to different reasons and it would be nice if the exception contains the exact reason returned in the response.