I want to implement proper error handling of onboarding errors. For this I need to get the error code from the response.
I have this code:
try {
$onboardService = new SecuredOnboardService($this->getEnvironment(), $this->getHttpClient());
$onboardParameters = $this->createOnboardParameters($regcode, $sfOrgId);
$onboardResponse = $onboardService->onboard($onboardParameters, $this->appPrivateKey);
} catch (OnboardException $e) {
// error handling
}
The problem is that $e->getMessage() returns this message:
Client error: `POST https://agrirouter-registration-service-hubqa-eu10.cfapps.eu10.hana.ondemand.com/api/v1.0/registration/onboard/request` resulted in a `400 Bad Request` response:
{"error":{"code":"0114","message":"Endpoint has recently been revoked. Please wait 3 minutes 44 seconds before trying to (truncated...)
Message was truncated by guzzle and there is no way to get the original response or code.
I want to implement proper error handling of onboarding errors. For this I need to get the error code from the response.
I have this code:
The problem is that
$e->getMessage()returns this message:Message was truncated by guzzle and there is no way to get the original response or code.