-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LF: Fix encoder for Exception (#9904)
* LF: Fix encoder for Exception CHANGELOG_BEGIN CHANGELOG_END * Update daml-lf/encoder/src/main/scala/com/digitalasset/daml/lf/archive/testing/EncodeV1.scala Co-authored-by: Sofia Faro <[email protected]> Co-authored-by: Sofia Faro <[email protected]>
- Loading branch information
1 parent
b22c046
commit 3dee3d0
Showing
6 changed files
with
49 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 1 addition & 12 deletions
13
...ncoder/src/test/lf/Builtin_1.13_1.dev_.lf → ...der/src/test/lf/BigNumeric_1.13_1.dev_.lf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module ExceptionMod { | ||
|
||
record @serializable Exception = { message: Text } ; | ||
exception Exception = { | ||
message \(e: ExceptionMod:Exception) -> | ||
ExceptionMod:Exception {message} e | ||
}; | ||
|
||
val anException: ExceptionMod:Exception = | ||
ExceptionMod:Exception {message = "oops"}; | ||
|
||
val throwAndCatch : Update Int64 = | ||
try @Int64 (upure @Int64 (throw @Int64 @ExceptionMod:Exception ExceptionMod:anException)) | ||
catch e -> Some @(Update Int64) (upure @Int64 77); | ||
|
||
val anAnyException: AnyException = | ||
to_any_exception @ExceptionMod:Exception ExceptionMod:anException; | ||
|
||
val anUnwrappedAnyException: Option ExceptionMod:Exception = | ||
from_any_exception @ExceptionMod:Exception ExceptionMod:anAnyException; | ||
|
||
val aMessage: Text = ANY_EXCEPTION_MESSAGE ExceptionMod:anAnyException; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters