codemix / restyii

A RESTful extension for Yii.
15 stars 10 forks source link

Adding error inspection of resource fetched by schema.php #42

Open JorgenSmith opened 11 years ago

JorgenSmith commented 11 years ago

Fixes up my previous PR https://github.com/codemix/restyii/pull/36 . In some cases the $config variable will hold a HTTP exception, and we need to catch this so as to enable more meaningful errors to be returned.

The patch will give me e.g. Error fetching 'productVariant'. CHttpException: Unable to resolve the request "productVariant/options".

Instead of `exception 'CException' with message 'Property "Restyii\Client\Schema\Resource.code" is not defined.``