Skip to content

Properly use self-service errors #886

Open
@canton-network-da

Description

@canton-network-da

[ This issue was auto-migrated from DA's internal repo (DACH-NY/canton-network-node#751). Original author: @rautenrieth-da ]

Replace all occurences of catching a ledger API error and matching the error message by string by properly using self-service error codes.

See also:

Moreover, follow Canton's guideline that if you assert on logs in tests:

            _.warningMessage should include("Lost subscription to domain"),

Then please use the error code directly:

            Seq(_.shouldBeCantonErrorCode(LostSequencerSubscription)),

Reasons:

  1. We can change the text in one go without having to change text in multiple places
  2. We can use IntelliJ to figure out which error code is referenced in which test.
  3. logger.error / logger.warn should not be used in canton. Everything on that logger level should be an error code (which in turn logs error or warning).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions