Skip to content

Commit

Permalink
Rename UserError and DevError
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel-williams-da committed Aug 3, 2023
1 parent f51cb54 commit b3868ac
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 42 deletions.
1 change: 1 addition & 0 deletions arbitrary_canton_sha
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
99262f40b996a162afddb1a78cf11e4dc570aa0b
2 changes: 1 addition & 1 deletion canton_dep.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
canton = {
"sha": "4eddd33ce0f302dfcdd33ba16c8f5261d869d4c87298f415be64a01b96c87a10",
"url": "https://www.canton.io/releases/canton-open-source-2.7.0-rc1.tar.gz",
"local": False,
"local": True,
}
60 changes: 30 additions & 30 deletions docs/resources/generated-error-pages/error-codes-inventory.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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))
Expand All @@ -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))
Expand All @@ -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))
Expand All @@ -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))
Expand All @@ -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))
Expand All @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {

Expand Down Expand Up @@ -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,
) {

Expand Down

0 comments on commit b3868ac

Please sign in to comment.