change timeout unit format to lowercase

This commit is contained in:
tommyskeff
2025-01-07 08:23:59 +00:00
parent f2ec06fba7
commit 08bf5eed1d

View File

@@ -454,13 +454,13 @@ public abstract class AbstractPromise<T, FS, FA> implements CompletablePromise<T
@Override @Override
public @NotNull Promise<T> timeout(long time, @NotNull TimeUnit unit) { public @NotNull Promise<T> timeout(long time, @NotNull TimeUnit unit) {
Exception e = new CancellationException("Promise timed out after " + time + " " + unit); Exception e = new CancellationException("Promise timed out after " + time + " " + unit.toString().toLowerCase());
return completeExceptionallyDelayed(e, time, unit); return completeExceptionallyDelayed(e, time, unit);
} }
@Override @Override
public @NotNull Promise<T> maxWaitTime(long time, @NotNull TimeUnit unit) { public @NotNull Promise<T> maxWaitTime(long time, @NotNull TimeUnit unit) {
Exception e = new TimeoutException("Promise stopped waiting after " + time + " " + unit); Exception e = new TimeoutException("Promise stopped waiting after " + time + " " + unit.toString().toLowerCase());
return completeExceptionallyDelayed(e, time, unit); return completeExceptionallyDelayed(e, time, unit);
} }