mirror of
https://github.com/valitydev/adapter-bank-payout-spring-boot-starter.git
synced 2024-11-06 00:45:21 +00:00
Merge pull request #14 from rbkmoney/ft/error_mapping_sleep
Added error mapping for sleep timeout reached
This commit is contained in:
commit
240cf407f8
2
pom.xml
2
pom.xml
@ -5,7 +5,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.rbkmoney</groupId>
|
||||
<artifactId>adapter-bank-payout-spring-boot-starter</artifactId>
|
||||
<version>1.0.1</version>
|
||||
<version>1.0.2</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Adapter-bank-payout-spring-boot-starter</name>
|
||||
|
@ -4,7 +4,6 @@ import com.rbkmoney.adapter.bank.payout.spring.boot.starter.config.properties.Ti
|
||||
import com.rbkmoney.adapter.bank.payout.spring.boot.starter.model.EntryStateModel;
|
||||
import com.rbkmoney.adapter.bank.payout.spring.boot.starter.model.ExitStateModel;
|
||||
import com.rbkmoney.damsel.base.Timer;
|
||||
import com.rbkmoney.damsel.domain.Failure;
|
||||
import com.rbkmoney.damsel.domain.TransactionInfo;
|
||||
import com.rbkmoney.damsel.withdrawals.provider_adapter.*;
|
||||
import com.rbkmoney.error.mapping.ErrorMapping;
|
||||
@ -42,9 +41,9 @@ public class IntentServiceImpl implements IntentService {
|
||||
throw new IllegalArgumentException("Need to specify 'maxTimePoolingMillis' before sleep");
|
||||
}
|
||||
if (exitStateModel.getNextState().getMaxTimePoolingMillis() < Instant.now().toEpochMilli()) {
|
||||
final Failure failure = new Failure("Sleep timeout");
|
||||
failure.setReason("Max time pool limit reached");
|
||||
return Intent.finish(new FinishIntent(FinishStatus.failure(failure)));
|
||||
String code = "Sleep timeout";
|
||||
String reason = "Max time pool limit reached";
|
||||
return Intent.finish(new FinishIntent(FinishStatus.failure(errorMapping.mapFailure(code, reason))));
|
||||
}
|
||||
|
||||
int timerPollingDelay = OptionsExtractors.extractPollingDelay(exitStateModel.getEntryStateModel().getOptions(), timerProperties.getPollingDelay());
|
||||
|
Loading…
Reference in New Issue
Block a user