Luracast / Restler

Simple and effective multi-format Web API Server to host your PHP API as Pragmatic REST and/or RESTful API
http://luracast.com/products/restler/
GNU Lesser General Public License v2.1
1.36k stars 316 forks source link

Aggressive Error catching? #362

Closed yankeeinlondon closed 10 years ago

yankeeinlondon commented 10 years ago

I'm a bit confused how it's happening but there are cases where I have a code problem which results in a 500 error but when that error occurs in Restler the error does not get written to the log file. For instance, here's the message I'm getting in my browser when I make the GET /api/resources.json call to load up my interface for the API explorer:

{
    "error": {
        "code": 500,
        "message": "Internal Server Error: Failed to connect libcouchbase to the server: Network failure"
    },
    "debug": {
        "source": "Connection.php:14 at authenticate stage",
        "stages": {
            "success": [
                "get",
                "route",
                "negotiate"
            ],
            "failure": [
                "authenticate",
                "message"
            ]
        }
    }
}

I can imagine there is an error in the couchbase connection as I've made a few changes there but I'd like to see this error in more detail. Sadly, there is nothing to be found in the php_errors.log file. In comparison, if I run a simple script that does NOT use Restler but has an intentional error in it it dumps the error normally.

It is possible that this isn't a Restler issue but it does appear associated at the moment. If you've seen this or have any ideas on where things might be going astray I'd be interested.

Arul- commented 10 years ago

Duty of restler is to make sure the response is in expected format (json) as much as possible, that's why you see the error wrapped in json. Restler does not prevent logging, it should be something else

just try making the connection at index.php itself to get detailed xdebug response!