From d1f5a39aaf327ac854d063af3ab5b6ec54509a67 Mon Sep 17 00:00:00 2001 From: Andrew Jewell <107044381+ajewellamz@users.noreply.github.com> Date: Tue, 17 Oct 2023 14:15:09 -0400 Subject: [PATCH] feat: Repair OpaqueError (#300) --- .../software/amazon/polymorph/smithydotnet/ServiceCodegen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithydotnet/ServiceCodegen.java b/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithydotnet/ServiceCodegen.java index 1224c21bd..3895247ee 100644 --- a/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithydotnet/ServiceCodegen.java +++ b/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithydotnet/ServiceCodegen.java @@ -257,7 +257,7 @@ public class OpaqueError : Exception { public readonly object obj; public OpaqueError(Exception ex) : base("OpaqueError:", ex) { this.obj = ex; } public OpaqueError() : base("Unknown Unexpected Error") { } - public OpaqueError(object obj) : base("Opaque obj is not an Exception.") { this.obj = obj;} + public OpaqueError(object obj) : base(obj is Exception ? "OpaqueError:" : "Opaque obj is not an Exception.", obj as Exception) { this.obj = obj;} } """ ).namespaced(Token.of(nameResolver.namespaceForService()));