Log Job retryable exceptions.

This commit is contained in:
Greyson Parrelli 2018-10-01 16:14:45 -07:00
parent 4799d30077
commit 12afdad291

View File

@ -74,7 +74,7 @@ public abstract class Job extends Worker implements Serializable {
} }
} catch (Exception e) { } catch (Exception e) {
if (onShouldRetry(e)) { if (onShouldRetry(e)) {
log("Retrying after a retryable exception." + logSuffix()); log("Retrying after a retryable exception." + logSuffix(), e);
return retry(); return retry();
} }
warn("Failing due to an exception." + logSuffix(), e); warn("Failing due to an exception." + logSuffix(), e);
@ -91,7 +91,7 @@ public abstract class Job extends Worker implements Serializable {
} }
final void onSubmit(UUID id) { final void onSubmit(UUID id) {
log(id, "onSubmit()"); Log.i(TAG, buildLog(id, "onSubmit()"));
onAdded(); onAdded();
} }
@ -184,11 +184,11 @@ public abstract class Job extends Worker implements Serializable {
} }
private void log(@NonNull String message) { private void log(@NonNull String message) {
log(getId(), message); log(message, null);
} }
private void log(@NonNull UUID id, @NonNull String message) { private void log(@NonNull String message, @Nullable Throwable t) {
Log.i(TAG, buildLog(id, message)); Log.i(TAG, buildLog(getId(), message), t);
} }
private void warn(@NonNull String message) { private void warn(@NonNull String message) {