Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.
This repository was archived by the owner on Aug 26, 2025. It is now read-only.

JSONP error handling for Exceptions #56

@adam-patterson

Description

@adam-patterson

The new JSONP handler is not handling our exceptions nicely. Typically when we generate an Exception new Exception($errorMsg, 400) presto ensures the HTTP response is the error code and the body would have $errorMsg. For JSONP responses I see the error code handled properly but the error message is not returned in the body. There is no body.

In the /v4/people API I just added throw new Exception('error message', 400); as the first line after the restrictTo call to generate this error.

Request URL:http://app.rubrix.test/v4/people/3065.js?callback=jQuery110105611689402721822_1373486935119&_=1373486935121
Request Method:GET
Status Code:400 API error
Request Headersview source
Accept:*/*
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Cookie:rx-auth=1r%2BQTP7tvwrZt%2BCTLhN6hCeunrpZmXGVGnxMMHF03Ff4%2BOFSfrD%2BlNMtq2%2By6tNKYlvOb2RBtXg6BVEGIGHCE30X7ysuNhMj9hlK8YZ5Y0JFAD4QkxWOIo2ERl%2FiBqI1s%2BnuxbMAO5D84Q3ZbBJ5wCKdSc2WqOZ%2B7v2P%2FXipHIa9O253tifLxPH1IBeu1y9l96F8%2FjcBgBXYT%2BOCKlyjuwkP5N%2Bl81l5La3zMEuOz%2BaK%2FD5L3vkfCgt1YvdnxBvmgySzZ4lq5eeH0H1BfojqW0mldT43vEWIDCDzZddAb6oXYGCCdWgjPDBRQcxoKuBeM4n7jeWdb2M%2Fs%2BOZCq8ktYmAbbSoCmYaBIZJHRNSL53lI078Lq9XmxBvBqcigIAf
Host:app.rubrix.test
Referer:http://reports.rubrix.test/explorable/performance/reviewer.html?codekitCB=395174602.397223
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36
Query String Parametersview sourceview URL encoded
callback:jQuery110105611689402721822_1373486935119
_:1373486935121
Response Headersview source
Cache-Control:private, no-cache, no-store, proxy-revalidate, no-transform
Connection:close
Content-Length:472
Content-Type:application/json
Date:Wed, 10 Jul 2013 20:09:39 GMT
Pragma:no-cache
Server:Apache/2.2.22 (Unix) DAV/2 PHP/5.3.15 with Suhosin-Patch mod_ssl/2.2.22 OpenSSL/0.9.8x
X-Api-Version:presto-v1.11
X-Powered-By:PHP/5.3.15

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions