Skip to content

undefined property: Carboneio\SDK\Responses\CarboneSdkResponse::$response on throw() #10

@beyto1974

Description

@beyto1974

Hi

Using carboneio/carbone-sdk-php:v2.0.0 and carbone.io 4.26.0 (open source).

How do you handle exceptions?

When I use throw() (usage of the saloonphp function), example:

$carbon->getStatus()->throw()->json()

I got

Undefined property: Carboneio\SDK\Responses\CarboneSdkResponse::$response

at vendor/carboneio/carbone-sdk-php/src/Responses/CarboneSdkResponse.php:21

public function toException(): CarboneSdkRequestException
     19▕     {
     20▕         if ($this->failed()) {
  ➜  21▕             $body = $this->response?->getBody()?->getContents();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions