Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
ajewellamz committed Nov 3, 2024
1 parent 1ec4d90 commit 8aaa3a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,8 @@ protected MethodSpec modeledUnion(final UnionShape shape) {

protected MethodSpec errorOpaque() {
final String methodName = "Error";
final TypeName inputType = subject.dafnyNameResolver.classForOpaqueWithTextError();
final TypeName inputType =
subject.dafnyNameResolver.classForOpaqueWithTextError();
final ClassName returnType = ClassName.get(RuntimeException.class);
return initializeMethodSpec(methodName, inputType, returnType)
.addComment("While the first two cases are logically identical,")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public static software.amazon.cryptography.services.kms.internaldafny.types.Erro
// An un-modeled Service Error is different from a Java Heap Exhaustion error.
// In the future, Smithy-Dafny MAY allow for this distinction.
// Which would allow Dafny developers to treat the two differently.
return software.amazon.cryptography.services.kms.internaldafny.types.Error.create_Opaque(nativeValue);
return software.amazon.cryptography.services.kms.internaldafny.types.Error.create_OpaqueWithText(nativeValue, dafny.DafnySequence.asString(nativeValue.getMessage()));
}
""";

Expand All @@ -129,7 +129,7 @@ public static software.amazon.cryptography.services.kms.internaldafny.types.Erro
// An un-modeled Service Error is different from a Java Heap Exhaustion error.
// In the future, Smithy-Dafny MAY allow for this distinction.
// Which would allow Dafny developers to treat the two differently.
return software.amazon.cryptography.services.kms.internaldafny.types.Error.create_Opaque(nativeValue);
return software.amazon.cryptography.services.kms.internaldafny.types.Error.create_OpaqueWithText(nativeValue, dafny.DafnySequence.asString(nativeValue.getMessage()));
}
""";

Expand Down

0 comments on commit 8aaa3a4

Please sign in to comment.