google-nomulus/java/google/registry
guyben 552940a816 Remove the reduntant 'afterFinalFailure' from Retrier
'afterFinalFailure' is called just before rethrowing a non-retrying error from
the retrier. This can happen either because the exception shouldn't be retried,
or because we exceeded the maximum number of retries.

The same thing can be done by catching that thrown error outside of the
retrier:

retrier.callWithRetry(
  callable,
  new FailureReporter() {
    @Override
    void afterFinalFailure(Throwable thrown, int failures) {
      // do something with thrown
    }
  },
  RetriableException.class);

is (almost) the same as:

try {
  retrier.callWithRetry(callable, RetriableException.class);
} catch (Throwable thrown) {
  // do something with thrown
  throw thrown;
}

("almost" because the retrier might wrap the Throwable in a RuntimeException,
so you might need to getCause or getRootCause. Also - there is the
"beforeRetry" I ignored for the example)

Removing "afterFinalFailure" also makes the FailureReporter in line with Java 8
functional interface - meaning we can more easily create it when we do need to
override "beforeRetry".

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189972101
2018-04-02 16:26:19 -04:00
..
backup Rationalize logging statements across codebase 2018-01-19 14:56:45 -05:00
batch Replace occurrences of Wrapped.valueOf(...) with Wrapped.parseWrapped(...) 2018-04-02 16:14:12 -04:00
beam Refactor ICANN reporting and billing into common package 2018-02-01 21:56:06 -05:00
bigquery Rationalize logging statements across codebase 2018-01-19 14:56:45 -05:00
braintree Switch from Guava Optionals to Java 8 Optionals 2017-10-24 16:53:47 -04:00
builddefs Rename set to depset in .bzl and BUILD files 2017-08-29 16:53:21 -04:00
config Make the async delete delay configurable in YAML config files 2018-03-06 19:06:52 -05:00
cron Remove empty TLD parameter when fanning out without TLDs 2018-04-02 16:24:27 -04:00
dns Increase Cloud DNS rate limit to 50 QPS 2018-03-06 19:21:54 -05:00
env Remove empty TLD parameter when fanning out without TLDs 2018-04-02 16:24:27 -04:00
export Refactor ICANN reporting and billing into common package 2018-02-01 21:56:06 -05:00
flows Default missing type= argument to "registration" in launch:create EPP extension 2018-04-02 16:22:54 -04:00
gcs Add publish functionality to billing pipeline 2018-01-04 17:17:59 -05:00
groups Clean up some code quality issues 2017-12-01 22:14:06 -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 Wrap exception properly in PgpHelper 2018-03-08 14:49:17 -05:00
loadtest Replace com.google.common.base.Function with java.util.function.Function 2017-12-27 11:08:55 -05:00
mapreduce Remove the reduntant 'afterFinalFailure' from Retrier 2018-04-02 16:26:19 -04:00
model Update default sunrush add grace period to 5 days 2018-04-02 16:21:14 -04:00
module Refactor ICANN reporting and billing into common package 2018-02-01 21:56:06 -05:00
monitoring/whitebox Rationalize logging statements across codebase 2018-01-19 14:56:45 -05:00
pricing Move backported JUnit file to third_party (part 2) 2017-12-02 11:37:46 -05:00
proxy Clean up some code quality issues in GCP proxy 2018-03-19 18:44:12 -04:00
rdap RDAP: Show registrar entity even if contacts are redacted 2018-03-06 19:00:47 -05:00
rde Add //third_party/java/jaxb dependency to targets using javax.xml.bind 2018-01-23 16:18:35 -05:00
reporting Remove the reduntant 'afterFinalFailure' from Retrier 2018-04-02 16:26:19 -04:00
request Replace occurrences of Wrapped.valueOf(...) with Wrapped.parseWrapped(...) 2018-04-02 16:14:12 -04:00
security Move backported JUnit file to third_party (part 2) 2017-12-02 11:37:46 -05:00
storage/drive Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
tldconfig/idn Replace occurrences of Wrapped.valueOf(...) with Wrapped.parseWrapped(...) 2018-04-02 16:14:12 -04:00
tmch Rationalize logging statements across codebase 2018-01-19 14:56:45 -05:00
tools Remove references to Eclipse 2018-03-19 18:45:41 -04:00
ui Mark <link href=""> with |blessStringAsTrustedResourceUrlForLegacy 2018-04-02 16:17:15 -04:00
util Remove the reduntant 'afterFinalFailure' from Retrier 2018-04-02 16:26:19 -04:00
whois Rationalize logging statements across codebase 2018-01-19 14:56:45 -05:00
xjc Add //third_party/java/jaxb dependency to targets using javax.xml.bind 2018-01-23 16:18:35 -05:00
xml Add //third_party/java/jaxb dependency to targets using javax.xml.bind 2018-01-23 16:18:35 -05:00
BUILD Add nocron ear and deployer rules for the crash environment 2017-10-04 16:16:45 -04:00
repositories.bzl Update FOSS build monitoring client version 2018-03-06 19:18:50 -05:00