Bump error mapping

This commit is contained in:
Inal Arsanukaev 2019-06-26 19:39:02 +03:00
parent 4ec453baef
commit 15ba445be3
3 changed files with 10 additions and 5 deletions

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.rbkmoney</groupId>
<artifactId>adapter-bank-payout-spring-boot-starter</artifactId>
<version>0.0.8-SNAPSHOT</version>
<version>0.0.9-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Adapter-bank-payout-spring-boot-starter</name>
@ -18,7 +18,7 @@
<damsel-utils.version>2.1.9</damsel-utils.version>
<damsel.version>1.303-d99319c</damsel.version>
<serializer.version>0.6.7</serializer.version>
<error-mapping.version>1.0.2</error-mapping.version>
<error-mapping.version>1.0.4</error-mapping.version>
</properties>
<dependencies>

View File

@ -5,7 +5,8 @@ import com.rbkmoney.adapter.bank.payout.spring.boot.starter.model.ExitStateModel
import com.rbkmoney.damsel.withdrawals.provider_adapter.Intent;
public interface IntentService {
Intent getFailure(ExitStateModel exitStateModel);
Intent getFailureByCode(ExitStateModel exitStateModel);
Intent getFailureByCodeAndDesc(ExitStateModel exitStateModel);
Intent getSuccess(ExitStateModel exitStateModel);
Intent getSleep(ExitStateModel exitStateModel);
Long getMaxDateTimeInstant(EntryStateModel entryStateModel);

View File

@ -22,8 +22,12 @@ public class IntentServiceImpl implements IntentService {
private final ErrorMapping errorMapping;
private final TimerProperties timerProperties;
public Intent getFailure(ExitStateModel exitStateModel) {
return Intent.finish(new FinishIntent(FinishStatus.failure(errorMapping.getFailureByCodeAndDescription(exitStateModel.getErrorCode(), exitStateModel.getErrorMessage()))));
public Intent getFailureByCode(ExitStateModel exitStateModel) {
return Intent.finish(new FinishIntent(FinishStatus.failure(errorMapping.mapFailure(exitStateModel.getErrorCode()))));
}
public Intent getFailureByCodeAndDesc(ExitStateModel exitStateModel) {
return Intent.finish(new FinishIntent(FinishStatus.failure(errorMapping.mapFailure(exitStateModel.getErrorCode(), exitStateModel.getErrorMessage()))));
}
public Intent getSuccess(ExitStateModel exitStateModel) {