ashwinks / PHP-LinkedIn-SDK

A PHP wrapper for the LinkedIn API
94 stars 74 forks source link

Exception Handling not satisfying #12

Closed kobelobster closed 9 years ago

kobelobster commented 9 years ago

Hello,

is it possible to get a better ExceptionHandling? The class only returns a RuntimeException. And the message is an array parsed into a string.

protected 'message' => string 'Request Error: Invalid access token.. Raw Response: Array ( [errorCode] => 0 [message] => Invalid access token. [requestId] => EZFSEK5QV1 [status] => 401 [timestamp] => 1424704122777 )

I mean, I could simplye RegEx the status to get a better status code, but this doesn't seem good practice. I like the class so far, however, reacting to errors is not satisfying.

ashwinks commented 9 years ago

Hi, I tried to keep this class as light as possible. Please feel free to fork it and add your own exception handling.