google-nomulus/java/google/registry
mcilwain 97c2049669 Catch errors when attempting to delete entities through Objectify
This is currently erroring out on entities that fail to load properly through Objectify (e.g. because their entity type is no longer registered).  The proper thing to do is to catch the error, log it, and fall back to the raw Datastore operation, which will succeed.

The exact Exception this is designed to catch is:

com.google.apphosting.runtime.jetty9.JettyLogger warn: /_dr/admin/deleteEntity (JettyLogger.java:29)
java.lang.IllegalStateException: No registered subclass for discriminator 'DomainApplication'
	at com.googlecode.objectify.v4.impl.PolymorphicEntityMetadata.getConcrete(PolymorphicEntityMetadata.java:133)
	at com.googlecode.objectify.v4.impl.PolymorphicEntityMetadata.load(PolymorphicEntityMetadata.java:164)
	at com.googlecode.objectify.v4.impl.LoadEngine.load(LoadEngine.java:220)
	at com.googlecode.objectify.v4.impl.LoadEngine$1.nowUncached(LoadEngine.java:178)
	at com.googlecode.objectify.v4.impl.LoadEngine$1.nowUncached(LoadEngine.java:164)
	at com.googlecode.objectify.v4.util.ResultCache.now(ResultCache.java:30)
	at com.googlecode.objectify.v4.impl.Round$1.nowUncached(Round.java:73)
	at com.googlecode.objectify.v4.util.ResultCache.now(ResultCache.java:30)
	at com.googlecode.objectify.v4.LoadResult.now(LoadResult.java:25)
	at google.registry.tools.server.DeleteEntityAction.loadOfyEntity(DeleteEntityAction.java:103)
	at google.registry.tools.server.DeleteEntityAction.run(DeleteEntityAction.java:74)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=230737553
2019-01-24 20:02:04 -05:00
..
backup Fix a few stylistic issues in preparation for Checkstyle addition 2019-01-24 19:57:14 -05:00
batch Add the App Engine service used in the Action definition 2019-01-17 18:59:16 -05:00
beam Switch all added usages of java.time to be joda.time 2018-12-12 13:22:34 -05:00
bigquery Account for GoogleJsonResponseException#getDetails returning null 2018-12-03 19:09:11 -05:00
builddefs Replace iteration over depsets with an explicit .to_list() call 2018-11-14 11:55:43 -05:00
config Remove deprecated Datastore backup code 2019-01-24 19:58:54 -05:00
cron Add the App Engine service used in the Action definition 2019-01-17 18:59:16 -05:00
dns Remove TLD @Parameter from inside the DnsMetrics 2019-01-17 19:12:41 -05:00
env Remove deprecated Datastore backup code 2019-01-24 19:58:54 -05:00
export Remove deprecated Datastore backup code 2019-01-24 19:58:54 -05:00
flows Always require acknowledgment of premium fees 2019-01-17 19:07:51 -05:00
gcs Clean up annotation imports in BUILD files 2018-06-27 15:28:53 -04:00
groups Account for GoogleJsonResponseException#getDetails returning null 2018-12-03 19:09:11 -05:00
idn Update IDN tables to comply with https://www.iana.org/help/idn-repository-procedure 2018-02-01 21:59:14 -05:00
keyring Fix a few stylistic issues in preparation for Checkstyle addition 2019-01-24 19:57:14 -05:00
loadtest Add the App Engine service used in the Action definition 2019-01-17 18:59:16 -05:00
mapreduce Send a plaintext link to the mapreduce console in fluent style 2019-01-10 17:14:06 -05:00
model Always require acknowledgment of premium fees 2019-01-17 19:07:51 -05:00
module Remove deprecated Datastore backup code 2019-01-24 19:58:54 -05:00
monitoring/whitebox Stop exporting EPP flow metrics to BigQuery 2018-10-08 16:59:29 -04:00
pricing Clean up third_party imports in BUILD files 2018-07-14 01:11:51 -04:00
proxy Use gson to make JSON string in proxy log formatter 2018-12-12 13:22:34 -05:00
rdap Add the App Engine service used in the Action definition 2019-01-17 18:59:16 -05:00
rde Consolidate Dagger modules for utils classes 2019-01-17 19:20:52 -05:00
reporting Add the App Engine service used in the Action definition 2019-01-17 18:59:16 -05:00
request Fix a few stylistic issues in preparation for Checkstyle addition 2019-01-24 19:57:14 -05:00
security Allow XSRF to be sent as POST parameter in addition to HTML header 2018-12-20 07:46:33 -05:00
storage/drive Clean up third_party imports in BUILD files 2018-07-14 01:11:51 -04:00
tldconfig/idn Remove the use of InjectRule in IdnLabelValidatorTest 2018-10-22 18:54:53 -04:00
tmch Consolidate Dagger modules for utils classes 2019-01-17 19:20:52 -05:00
tools Catch errors when attempting to delete entities through Objectify 2019-01-24 20:02:04 -05:00
ui Add a button in the admin panel to check OT&E status of a registrar 2019-01-18 15:35:40 -05:00
util Consolidate Dagger modules for utils classes 2019-01-17 19:20:52 -05:00
whois Add the App Engine service used in the Action definition 2019-01-17 18:59:16 -05:00
xjc Run bazel installer as a argument to bash 2018-08-10 13:44:25 -04:00
xml Pretty-print actual XML in tests 2018-07-14 01:37:03 -04:00
BUILD Remove deprecated DNS subsystem 2018-09-14 12:01:08 -04:00
repositories.bzl Use Guava instead of Apache Commons for file ops in Ghostryde 2019-01-11 11:00:33 -05:00