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

[Self-service error codes] Group explanations #11715

Merged
merged 2 commits into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.daml.error.definitions.ErrorGroups.ParticipantErrorGroup.IndexErrorGr
import com.daml.error.utils.ErrorDetails
import io.grpc.StatusRuntimeException

@Explanation("Errors raised by the Participant Index persistence layer.")
object IndexErrors extends IndexErrorGroup {
object DatabaseErrors extends DatabaseErrorGroup {
@Explanation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import org.slf4j.event.Level

import java.time.{Duration, Instant}

@Explanation(
"Errors raised by or forwarded by the Ledger API."
)
object LedgerApiErrors extends LedgerApiErrorGroup {
@Explanation(
"""This error occurs when a participant rejects a command due to excessive load.
Expand Down Expand Up @@ -58,6 +61,9 @@ object LedgerApiErrors extends LedgerApiErrorGroup {
)
}

@Explanation(
"Errors raised during the command execution phase of the command submission evaluation."
)
object CommandExecution extends ErrorGroup {
@Explanation(
"""This error occurs if the participant fails to determine the max ledger time of the used
Expand All @@ -80,6 +86,7 @@ object LedgerApiErrors extends LedgerApiErrorGroup {
)
}

@Explanation("Command execution errors raised due to invalid packages.")
object Package extends ErrorGroup() {
@Explanation(
"""This error indicates that the uploaded DAR is based on an unsupported language version."""
Expand Down Expand Up @@ -128,6 +135,9 @@ object LedgerApiErrors extends LedgerApiErrorGroup {
}
}

@Explanation(
"Errors raised during command conversion to the internal data representation."
)
object Preprocessing extends ErrorGroup {
@Explanation("""This error occurs if a command fails during interpreter pre-processing.""")
@Resolution("Inspect error details and correct your application.")
Expand All @@ -146,6 +156,9 @@ object LedgerApiErrors extends LedgerApiErrorGroup {
}
}

@Explanation(
"Errors raised during the command interpretation phase of the command submission evaluation."
)
object Interpreter extends ErrorGroup {
@Explanation("""This error occurs if a Daml transaction fails during interpretation.""")
@Resolution("This error type occurs if there is an application error.")
Expand Down Expand Up @@ -205,6 +218,7 @@ object LedgerApiErrors extends LedgerApiErrorGroup {

}

@Explanation("Errors raised in lookups during the command interpretation phase.")
object LookupErrors extends ErrorGroup {
@Explanation(
"""This error occurs if the Daml engine interpreter cannot resolve a contract key to an active contract. This
Expand Down Expand Up @@ -274,6 +288,7 @@ object LedgerApiErrors extends LedgerApiErrorGroup {
)
}

@Explanation("Authentication errors.")
object AuthorizationChecks extends ErrorGroup() {
@Explanation(
"""This rejection is given if the submitted command does not contain a JWT token on a participant enforcing JWT authentication."""
Expand Down Expand Up @@ -326,6 +341,9 @@ object LedgerApiErrors extends LedgerApiErrorGroup {
}
}

@Explanation(
"Validation errors raised when evaluating requests in the Ledger API."
)
object RequestValidation extends ErrorGroup {
object NotFound extends ErrorGroup() {
@Explanation(
Expand Down Expand Up @@ -606,6 +624,7 @@ object LedgerApiErrors extends LedgerApiErrorGroup {
) extends LoggingTransactionErrorImpl(cause = message, throwableO = throwableO)
}

@Explanation("Errors raised by Ledger API admin services.")
object AdminServices {
@Explanation("This rejection is given when a new configuration is rejected.")
@Resolution("Fetch newest configuration and/or retry.")
Expand Down Expand Up @@ -636,6 +655,9 @@ object LedgerApiErrors extends LedgerApiErrorGroup {
}
}

@Explanation(
"Potential consistency errors raised due to race conditions during command submission or returned as submission rejections by the backing ledger."
)
object ConsistencyErrors extends ErrorGroup {
@Explanation("A command with the given command id has already been successfully processed.")
@Resolution(
Expand Down Expand Up @@ -796,6 +818,9 @@ object LedgerApiErrors extends LedgerApiErrorGroup {
}
}

@Explanation(
"Generic submission rejection errors returned by the backing ledger's write service."
)
object WriteServiceRejections extends ErrorGroup {
@Explanation("The submitting party has not been allocated.")
@Resolution(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ abstract class LoggingPackageServiceError(
final override def logOnCreation: Boolean = true
}

@Explanation(
"Errors raised by the Package Management Service on package uploads."
)
object PackageServiceError extends LedgerApiErrors.PackageServiceErrorGroup {
@Explanation("Package parsing errors raised during package upload.")
object Reading extends ErrorGroup {
@Explanation(
"""This error indicates that the supplied dar file name did not meet the requirements to be stored in the persistence store."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import com.daml.error.{
import com.daml.ledger.participant.state.kvutils.committer.transaction.Rejection.InternallyInconsistentTransaction

@Explanation(
"Errors that are specific to ledgers based on the KV architecture. " +
"Note that this section will soon cover all ledgers due to an ongoing error consolidation effort."
"Errors that are specific to ledgers based on the KV architecture: Daml Sandbox and VMBC."
)
object KVErrors extends ErrorGroup()(ErrorGroups.rootErrorClass) {

Expand Down