-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Ledger API error codes] Extracted common errors and groups [DPP-607] (…
…#10890) * Extracted common error implementations * ErrorGroups * TransactionError hierarchy * LedgerApiErrors * PackageServiceError * ProtoDeserializationError * PruningServiceError * SubmissionErrors CHANGELOG_BEGIN CHANGELOG_END * Adapt extracted error groups and definitions to adhere to local tech stack: * Use //ledger/error:error core API * Use DAML SDK logging stack * Manual rebase to latest changes from Canton * Extracted RejectionGenerator from Canton * Adapted RejectionGenerator * Added //ledger/error:error to artifacts * Pass correlationId to errors * Pass parameters as implicits to shave some lines and improve readability * Workaround for encountered Scala/JDK8 bug * Addressed Ratko's review comments
- Loading branch information
Showing
16 changed files
with
1,349 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...r/participant-integration-api/src/main/scala/platform/apiserver/error/CorrelationId.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package com.daml.platform.apiserver.error | ||
|
||
case class CorrelationId(id: Option[String]) extends AnyVal | ||
case object CorrelationId { | ||
def none: CorrelationId = CorrelationId(None) | ||
} |
24 changes: 24 additions & 0 deletions
24
ledger/participant-integration-api/src/main/scala/platform/apiserver/error/ErrorGroups.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package com.daml.platform.apiserver.error | ||
|
||
import com.daml.error.{ErrorClass, ErrorGroup} | ||
|
||
object ErrorGroups { | ||
|
||
private implicit val errorClass: ErrorClass = ErrorClass.root() | ||
|
||
abstract class ProtoDeserializationErrorGroup extends ErrorGroup | ||
|
||
object ParticipantErrorGroup extends ErrorGroup() { | ||
abstract class PackageServiceErrorGroup extends ErrorGroup() | ||
abstract class PruningServiceErrorGroup extends ErrorGroup() | ||
object TransactionErrorGroup extends ErrorGroup() { | ||
// Errors emitted by Ledger Api server | ||
abstract class LedgerApiErrorGroup extends ErrorGroup() | ||
// TransactionSubmissionErrors are routing errors resulting from the transaction processor | ||
abstract class SubmissionErrorGroup extends ErrorGroup() | ||
} | ||
} | ||
} |
Oops, something went wrong.