Skip to content

Commit

Permalink
Minor ErrorValue refactoring for better default messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mikera committed Oct 1, 2024
1 parent de1a4c7 commit e4afe4b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion convex-core/src/main/java/convex/core/lang/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public CVMLong getPosition(Symbol sym) {
}

/**
* Inner class for less-frequently changing CVM state related to Actor execution
* Immutable inner class for less-frequently changing CVM state
* Should save some allocation / GC on average, since it will change less
* frequently than the surrounding Context and can be cheaply copied by reference.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,16 @@ public class ErrorValue extends AThrowable {
private Address address=null;

static {
addDefaultError(ErrorCodes.ARGUMENT,"Invalid argument value");
addDefaultError(ErrorCodes.ARGUMENT,"Invalid argument");
addDefaultError(ErrorCodes.NOBODY,"Account does not exist");
addDefaultError(ErrorCodes.FUNDS,"Funds not available");
addDefaultError(ErrorCodes.JUICE,"Out of juice");
addDefaultError(ErrorCodes.CAST,"Illegal type cast");
addDefaultError(ErrorCodes.ASSERT,"Assertion failed");
addDefaultError(ErrorCodes.ARITY,"Wrong number of arguments");
addDefaultError(ErrorCodes.BOUNDS,"Out of bounds");
addDefaultError(ErrorCodes.TODO,"Not implemented");
addDefaultError(ErrorCodes.MEMORY,"Out of memory");
}

private ErrorValue(ACell code, ACell message) {
Expand Down

0 comments on commit e4afe4b

Please sign in to comment.