Skip to content

Commit

Permalink
fix: panic due to mistake on error logging & phantom decision with tr…
Browse files Browse the repository at this point in the history
…ansfercheck
  • Loading branch information
Pascal-Delange committed Nov 21, 2024
1 parent 5f657dd commit 616652b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions models/role_permission.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ var ROLES_PERMISSIOMS = map[Role][]Permission{
TRANSFER_CREATE,
TRANSFER_UPDATE,
DECISION_CREATE,
PHANTOM_DECISION_CREATE,
},
TRANSFER_CHECK_USER: {
TRANSFER_READ,
Expand Down
4 changes: 3 additions & 1 deletion usecases/decision_usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,9 @@ func (usecase *DecisionUsecase) CreateDecision(
logger := utils.LoggerFromContext(ctx).With("phantom_decisions_with_scenario_id", phantomInput.Scenario.Id)
_, errPhantom := usecase.phantomUseCase.CreatePhantomDecision(ctx, phantomInput, evaluationParameters)
if errPhantom != nil {
logger.ErrorContext(ctx, fmt.Sprintf("Error when creating phantom decisions with scenario id %s: %s", phantomInput.Scenario.Id, err.Error()))
logger.ErrorContext(ctx,
fmt.Sprintf("Error when creating phantom decisions with scenario id %s: %s",
phantomInput.Scenario.Id, errPhantom.Error()))
}
}()

Expand Down

0 comments on commit 616652b

Please sign in to comment.