Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove user-management error cases from scenario-service proto. #12460

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove user-management error cases from scenario-service proto.
changelog_begin
changelog_end
  • Loading branch information
nickchapman-da committed Jan 18, 2022
commit 58c5af87b8376386669a772755da2a1e34db80a8
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,6 @@ prettyScenarioErrorError (Just err) = do
ScenarioErrorErrorScenarioPartyAlreadyExists name ->
pure $ "Tried to allocate a party that already exists: " <-> ltext name

ScenarioErrorErrorScenarioUserNotFound userId ->
pure $ "User not found: " <-> ltext userId
ScenarioErrorErrorScenarioUserAlreadyExists userId ->
pure $ "User already exists: " <-> ltext userId

ScenarioErrorErrorScenarioContractNotVisible ScenarioError_ContractNotVisible{..} ->
pure $ vcat
[ "Attempt to fetch or exercise a contract not visible to the reading parties."
Expand Down
2 changes: 0 additions & 2 deletions compiler/scenario-service/protos/scenario_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,6 @@ message ScenarioError {
Empty ComparableValueError = 29;
ContractIdInContractKey contract_id_in_contract_key = 30;
Empty ValueExceedsMaxNesting = 31;
string scenario_user_not_found = 33;
string scenario_user_already_exists = 34;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,7 @@ final class Conversions(
builder.setScenarioPartyAlreadyExists(party)

case Error.UserManagement(err) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this error case in the Scala AST? It seems like we should never hit this now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact we now don't need a type for UserManagementError in daml-script at all... It remained used only to communicate from UserManagementStore to IdeLedgerClient, where it was reduced anyway to just Option.

I changed to have the same Option based interface also in UserManagementStore.

And code just gets removed!

err match {
case Error.UserManagementError.UserNotFound(userId) =>
builder.setScenarioUserNotFound(userId)
case Error.UserManagementError.UserExists(userId) =>
builder.setScenarioUserAlreadyExists(userId)
}
builder.setCrash(s"UserManagement error unhandled in scenario service: $err")
}
builder.build
}
Expand Down