IsraelOrtuno / pipedrive

Complete Pipedrive API client for PHP
MIT License
166 stars 58 forks source link

ErrorException: Attempt to read property "message" on string #111

Closed stayallive closed 3 years ago

stayallive commented 3 years ago

Unfortunately #108 seems to have broken some other things and not only fixed things :)

ErrorException: Attempt to read property "message" on string
#20 /vendor/devio/pipedrive/src/Http/Request.php(92): Illuminate\Foundation\Bootstrap\HandleExceptions::handleError
#19 /vendor/devio/pipedrive/src/Http/Request.php(92): Devio\Pipedrive\Http\Request::handleResponse
#18 /vendor/devio/pipedrive/src/Http/Request.php(67): Devio\Pipedrive\Http\Request::executeRequest
#17 /vendor/devio/pipedrive/src/Http/Request.php(53): Devio\Pipedrive\Http\Request::performRequest
#16 /vendor/devio/pipedrive/src/Http/Request.php(134): Devio\Pipedrive\Http\Request::__call
#15 /vendor/devio/pipedrive/src/Resources/Basics/Resource.php(100): Devio\Pipedrive\Resources\Basics\Resource::update
#14 /app/Console/Commands/SyncPipedrive.php(117): App\Console\Commands\SyncPipedrive::handle

It looks like it needs a better check since $message->error can either be a string or an object with a nested message property.

kw-pr commented 3 years ago

Yes, I got the same problem.

rkuntoro commented 3 years ago

Getting a similar error:

Uncaught exception 'Error' with message 'Wrong parameters for Devio\Pipedrive\Exceptions\PipedriveException([string $message [, long $code [, Throwable $previous = NULL]]])' in /var/www/app/qm/vendors/devio/pipedrive/src/Http/Request.php:92

When accessing $pipedrive->organizations->findByName(). Seemed to happen only a few times and I cannot replicate it yet (found in logs). Using v2.10.1