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

Backport: Rename UserError and DevError #17227

Merged
merged 2 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Rename UserError and DevError
  • Loading branch information
samuel-williams-da authored and remyhaemmerle-da committed Aug 4, 2023
commit c6d92db4ad7f99d094c4269f0acc5c04f1f65694
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