Исправления обработки ошибок
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Struchkov Mark 2023-03-15 00:01:59 +03:00
parent cb44dab413
commit 88beadb445
Signed by: upagge
GPG Key ID: D3018BE7BA428CA6

View File

@ -151,15 +151,16 @@ public class GeneralAutoResponder<M extends Message> {
}
public void answer(UnitRequest<MainUnit<M>, M> unitRequest) {
if (checkNotNull(errorHandler)) {
try {
unitRequest = getAction(unitRequest);
activeUnitAfter(unitRequest);
} catch (Exception e) {
if (checkNotNull(errorHandler)) {
errorHandler.handle(unitRequest.getMessage(), e);
} else {
throw e;
}
} else {
unitRequest = getAction(unitRequest);
activeUnitAfter(unitRequest);
}
}