google-nomulus/javatests/google/registry
nickfelt 16832323d0 Make ListObjectsAction return 200 when sending JSON error
This fixes a bug in the interaction between ListObjectsAction and ListObjectsCommand/AppEngineConnection.  ListObjectsAction was returning HTTP status code 400 when it caught an IAE, but also attempting to return a JSON response payload of {"status": "error", "error": "<exception message>"}.  However, AppEngineConnection treats any HTTP error response as more like a crash on the server side - it attempts to scrape the error message out of the autogenerated HTML that AppEngine produces for uncaught exceptions, and throws an exception, killing ListObjectsCommand before it can extract the JSON which contains the nicer error (that stating the missing field, etc versus just "400 Bad Request").

The fix is just to have ListObjectsAction return a 200 and the error message so that ListObjectsCommand can correctly handle it.

I also de-scoped the catch to only catching IAE, since catching Exception was overbroad, and the only "expected" exception to be thrown is an IAE from the checkArgument() that tests if the requested fields all exist.  Any other kinds of exceptions should actually just bubble up and kill the action, and get the regular AppEngineConnection error treatment.

I also added "billingId" as an alias for "billingIdentifier", parallel to clientId/clientIdentifier, since that's why I came across this issue in the first place.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=148248834
2017-02-27 11:10:37 -05:00
..
backup Add @VirtualEntity checking to Ofy's deleteWithoutBackup() 2017-02-08 17:31:07 -05:00
batch Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
bigquery Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
builddefs Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
config Remove unnecessary line to load configs 2017-02-27 11:07:40 -05:00
cron Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
dns Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
export Add Cloud KMS based secret storage 2017-02-17 12:22:12 -05:00
flows Improve handling of lastSubordinateChange and beef up tests 2017-02-17 12:23:36 -05:00
groups Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
keyring/kms Add Cloud KMS based secret storage 2017-02-17 12:22:12 -05:00
mapreduce/inputs Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
model Add Cloud KMS based secret storage 2017-02-17 12:22:12 -05:00
module Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
monitoring Re-add some accidentally removed license headers 2017-02-06 16:45:23 -05:00
pricing Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
rdap Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
rde Fix a comment nit (can't @link to a generic type) 2017-02-17 12:20:45 -05:00
request Daggerize XsrfTokenManager 2017-02-22 11:43:10 -05:00
security Daggerize XsrfTokenManager 2017-02-22 11:43:10 -05:00
server Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
storage/drive Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
testing Daggerize XsrfTokenManager 2017-02-22 11:43:10 -05:00
tldconfig/idn Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
tmch Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
tools Make ListObjectsAction return 200 when sending JSON error 2017-02-27 11:10:37 -05:00
ui Daggerize XsrfTokenManager 2017-02-22 11:43:10 -05:00
util Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
whois Tighten up restrictions on domain/host naming on EPP resources 2017-02-07 13:29:03 -05:00
xjc Add mapper to import domains from RDE deposits 2017-02-06 16:46:46 -05:00
xml Update copyright year on all license headers 2017-02-02 16:27:22 -05:00