google-nomulus/java/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 Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
batch Replace 'host.getSubordinateHost() != null' with 'host.isSubordinate()' 2017-02-06 16:45:23 -05:00
bigquery Change BigQuery call from update to patch 2017-02-06 16:45:23 -05:00
braintree 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 Put the path to client_secrets in a config option. 2017-02-22 11:49:03 -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
eclipse Restructure Maven dependencies in build 2017-01-09 11:59:04 -05:00
env Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
export Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
flows Improve handling of lastSubordinateChange and beef up tests 2017-02-17 12:23:36 -05:00
gcs Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
groups Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
idn Run buildifier on codebase to format BUILD files 2016-11-28 18:15:21 -05:00
keyring Add Cloud KMS based secret storage 2017-02-17 12:22:12 -05:00
loadtest Daggerize XsrfTokenManager 2017-02-22 11:43:10 -05:00
mapreduce Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
model Improve handling of lastSubordinateChange and beef up tests 2017-02-17 12:23:36 -05:00
module Daggerize XsrfTokenManager 2017-02-22 11:43:10 -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 Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
request Daggerize XsrfTokenManager 2017-02-22 11:43:10 -05:00
security Daggerize XsrfTokenManager 2017-02-22 11:43:10 -05:00
storage/drive Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
tldconfig/idn Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
tmch Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -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 Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
whois Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
xjc Add mapper to import domains from RDE deposits 2017-02-06 16:46:46 -05:00
xml Replace Throwables.propagate and variants with Guava 20 versions 2017-02-02 17:01:23 -05:00
BUILD Move the environment configuration YAML files into the main JAR 2017-02-06 16:46:52 -05:00
repositories.bzl Add Cloud KMS based secret storage 2017-02-17 12:22:12 -05:00