From c6d92db4ad7f99d094c4269f0acc5c04f1f65694 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Thu, 3 Aug 2023 13:48:55 +0100 Subject: [PATCH 1/2] Rename UserError and DevError --- .../error-codes-inventory.rst.inc | 60 +++++++++---------- .../suites/v1_8/DeeplyNestedValueIT.scala | 14 ++--- .../definitions/groups/CommandExecution.scala | 8 +-- 3 files changed, 41 insertions(+), 41 deletions(-) diff --git a/docs/resources/generated-error-pages/error-codes-inventory.rst.inc b/docs/resources/generated-error-pages/error-codes-inventory.rst.inc index 4360d4b96294..32927d9cc35f 100755 --- a/docs/resources/generated-error-pages/error-codes-inventory.rst.inc +++ b/docs/resources/generated-error-pages/error-codes-inventory.rst.inc @@ -839,50 +839,66 @@ DAML_INTERPRETER_INVALID_ARGUMENT -.. _error_code_DEV_ERROR: +.. _error_code_DISCLOSED_CONTRACT_KEY_HASHING_ERROR: -DEV_ERROR +DISCLOSED_CONTRACT_KEY_HASHING_ERROR --------------------------------------------------------------------------------------------------------------------------------------- - **Explanation**: This error is a catch-all for errors thrown by in-development features, and should never be thrown in production. + **Explanation**: This error occurs if a user attempts to provide a key hash for a disclosed contract which we have already cached to be different. **Category**: InvalidGivenCurrentSystemStateOther **Conveyance**: This error is logged with log-level INFO on the server side and exposed on the API with grpc-status FAILED_PRECONDITION including a detailed error message. - **Resolution**: See the error message for details of the specific in-development feature error. If this is production, avoid using development features. + **Resolution**: Ensure the contract ID and contract payload you have provided in your disclosed contract is correct. -.. _error_code_DISCLOSED_CONTRACT_KEY_HASHING_ERROR: +.. _error_code_FETCH_EMPTY_CONTRACT_KEY_MAINTAINERS: -DISCLOSED_CONTRACT_KEY_HASHING_ERROR +FETCH_EMPTY_CONTRACT_KEY_MAINTAINERS --------------------------------------------------------------------------------------------------------------------------------------- - **Explanation**: This error occurs if a user attempts to provide a key hash for a disclosed contract which we have already cached to be different. + **Explanation**: This error occurs when you try to fetch a contract by key, but that key would have empty maintainers. + + **Category**: InvalidIndependentOfSystemState + + **Conveyance**: This error is logged with log-level INFO on the server side and exposed on the API with grpc-status INVALID_ARGUMENT including a detailed error message. + + **Resolution**: Check the definition of the contract key's maintainers, and ensure this list won't be empty given the contract key you are fetching. + + + + +.. _error_code_INTERPRETATION_DEV_ERROR: + +INTERPRETATION_DEV_ERROR +--------------------------------------------------------------------------------------------------------------------------------------- + + **Explanation**: This error is a catch-all for errors thrown by in-development features, and should never be thrown in production. **Category**: InvalidGivenCurrentSystemStateOther **Conveyance**: This error is logged with log-level INFO on the server side and exposed on the API with grpc-status FAILED_PRECONDITION including a detailed error message. - **Resolution**: Ensure the contract ID and contract payload you have provided in your disclosed contract is correct. + **Resolution**: See the error message for details of the specific in-development feature error. If this is production, avoid using development features. -.. _error_code_FETCH_EMPTY_CONTRACT_KEY_MAINTAINERS: +.. _error_code_INTERPRETATION_USER_ERROR: -FETCH_EMPTY_CONTRACT_KEY_MAINTAINERS +INTERPRETATION_USER_ERROR --------------------------------------------------------------------------------------------------------------------------------------- - **Explanation**: This error occurs when you try to fetch a contract by key, but that key would have empty maintainers. + **Explanation**: This error occurs when a user calls abort or error on an LF version before native exceptions were introduced. - **Category**: InvalidIndependentOfSystemState + **Category**: InvalidGivenCurrentSystemStateOther - **Conveyance**: This error is logged with log-level INFO on the server side and exposed on the API with grpc-status INVALID_ARGUMENT including a detailed error message. + **Conveyance**: This error is logged with log-level INFO on the server side and exposed on the API with grpc-status FAILED_PRECONDITION including a detailed error message. - **Resolution**: Check the definition of the contract key's maintainers, and ensure this list won't be empty given the contract key you are fetching. + **Resolution**: Either remove the call to abort, error or perhaps assert, or ensure you are exercising your contract choice as the author expects. @@ -935,22 +951,6 @@ UNHANDLED_EXCEPTION -.. _error_code_USER_ERROR: - -USER_ERROR ---------------------------------------------------------------------------------------------------------------------------------------- - - **Explanation**: This error occurs when a user calls abort or error on an LF version before native exceptions were introduced. - - **Category**: InvalidGivenCurrentSystemStateOther - - **Conveyance**: This error is logged with log-level INFO on the server side and exposed on the API with grpc-status FAILED_PRECONDITION including a detailed error message. - - **Resolution**: Either remove the call to abort, error or perhaps assert, or ensure you are exercising your contract choice as the author expects. - - - - .. _error_code_WRONGLY_TYPED_CONTRACT: WRONGLY_TYPED_CONTRACT diff --git a/ledger-test-tool/suites/src/main/scala/com/daml/ledger/api/testtool/suites/v1_8/DeeplyNestedValueIT.scala b/ledger-test-tool/suites/src/main/scala/com/daml/ledger/api/testtool/suites/v1_8/DeeplyNestedValueIT.scala index 165ef0ce0f6f..7e271bd7ecc2 100644 --- a/ledger-test-tool/suites/src/main/scala/com/daml/ledger/api/testtool/suites/v1_8/DeeplyNestedValueIT.scala +++ b/ledger-test-tool/suites/src/main/scala/com/daml/ledger/api/testtool/suites/v1_8/DeeplyNestedValueIT.scala @@ -127,7 +127,7 @@ final class DeeplyNestedValueIT extends LedgerTestSuite { test( "exercise argument", - LedgerApiErrors.CommandExecution.Interpreter.DevError, + LedgerApiErrors.CommandExecution.Interpreter.InterpretationDevError, ) { implicit ec => (alpha, party) => for { handler <- alpha.create(party, Handler(party)) @@ -142,7 +142,7 @@ final class DeeplyNestedValueIT extends LedgerTestSuite { test( "exercise output", - LedgerApiErrors.CommandExecution.Interpreter.DevError, + LedgerApiErrors.CommandExecution.Interpreter.InterpretationDevError, ) { implicit ec => (alpha, party) => for { handler <- alpha.create(party, Handler(party)) @@ -153,7 +153,7 @@ final class DeeplyNestedValueIT extends LedgerTestSuite { test( "create argument", - LedgerApiErrors.CommandExecution.Interpreter.DevError, + LedgerApiErrors.CommandExecution.Interpreter.InterpretationDevError, ) { implicit ec => (alpha, party) => for { handler <- alpha.create(party, Handler(party)) @@ -163,7 +163,7 @@ final class DeeplyNestedValueIT extends LedgerTestSuite { test( "contract key", - LedgerApiErrors.CommandExecution.Interpreter.DevError, + LedgerApiErrors.CommandExecution.Interpreter.InterpretationDevError, ) { implicit ec => (alpha, party) => for { handler <- alpha.create(party, Handler(party)) @@ -176,7 +176,7 @@ final class DeeplyNestedValueIT extends LedgerTestSuite { // it does not make sense to test fetch of those kinds of contracts. test( "fetch by key", - LedgerApiErrors.CommandExecution.Interpreter.DevError, + LedgerApiErrors.CommandExecution.Interpreter.InterpretationDevError, ) { implicit ec => (alpha, party) => for { handler <- alpha.create(party, Handler(party)) @@ -188,7 +188,7 @@ final class DeeplyNestedValueIT extends LedgerTestSuite { test( "failing lookup by key", - LedgerApiErrors.CommandExecution.Interpreter.DevError, + LedgerApiErrors.CommandExecution.Interpreter.InterpretationDevError, ) { implicit ec => (alpha, party) => for { handler <- alpha.create(party, Handler(party)) @@ -201,7 +201,7 @@ final class DeeplyNestedValueIT extends LedgerTestSuite { // it does not make sens to test successful lookup for those keys. test( "successful lookup by key", - LedgerApiErrors.CommandExecution.Interpreter.DevError, + LedgerApiErrors.CommandExecution.Interpreter.InterpretationDevError, ) { implicit ec => (alpha, party) => for { handler <- alpha.create(party, Handler(party)) diff --git a/ledger/ledger-api-errors/src/main/scala/com/daml/error/definitions/groups/CommandExecution.scala b/ledger/ledger-api-errors/src/main/scala/com/daml/error/definitions/groups/CommandExecution.scala index 07d341b31a43..6c7b742f1388 100644 --- a/ledger/ledger-api-errors/src/main/scala/com/daml/error/definitions/groups/CommandExecution.scala +++ b/ledger/ledger-api-errors/src/main/scala/com/daml/error/definitions/groups/CommandExecution.scala @@ -328,9 +328,9 @@ object CommandExecution extends ErrorGroup()(LedgerApiErrors.errorClass) { @Resolution( "Either remove the call to abort, error or perhaps assert, or ensure you are exercising your contract choice as the author expects." ) - object UserError + object InterpretationUserError extends ErrorCode( - id = "USER_ERROR", + id = "INTERPRETATION_USER_ERROR", ErrorCategory.InvalidGivenCurrentSystemStateOther, ) { @@ -599,9 +599,9 @@ object CommandExecution extends ErrorGroup()(LedgerApiErrors.errorClass) { @Resolution( "See the error message for details of the specific in-development feature error. If this is production, avoid using development features." ) - object DevError + object InterpretationDevError extends ErrorCode( - id = "DEV_ERROR", + id = "INTERPRETATION_DEV_ERROR", ErrorCategory.InvalidGivenCurrentSystemStateOther, ) { From 6ffab47f9979c7abc0f153c72ab618fa555ed6ae Mon Sep 17 00:00:00 2001 From: Remy Haemmerle Date: Fri, 4 Aug 2023 14:47:26 +0200 Subject: [PATCH 2/2] activate DeeplyNestedValueIT (disable in #17228) --- ledger-test-tool/tool/BUILD.bazel | 1 - 1 file changed, 1 deletion(-) diff --git a/ledger-test-tool/tool/BUILD.bazel b/ledger-test-tool/tool/BUILD.bazel index b8d9f764d54e..e9f404021ae2 100644 --- a/ledger-test-tool/tool/BUILD.bazel +++ b/ledger-test-tool/tool/BUILD.bazel @@ -192,7 +192,6 @@ conformance_test_excluded_test = [ "CommandDeduplicationPeriodValidationIT:OffsetPruned", # requires pruning not available in canton community "ActiveContractsServiceIT:AcsBeforePruningOffsetIsDisallowed", # requires pruning not available in canton community "ActiveContractsServiceIT:AcsAtPruningOffsetIsAllowed", # requires pruning not available in canton community - "DeeplyNestedValueIT", ] # conformance tests for default and latest