File tree 2 files changed +27
-24
lines changed
2 files changed +27
-24
lines changed Original file line number Diff line number Diff line change @@ -216,3 +216,30 @@ func toConstExpTrace(cte *ConstExpr) string {
216
216
217
217
return tv .T .String ()
218
218
}
219
+
220
+ //----------------------------------------
221
+ // Exception
222
+
223
+ // Exception represents a panic that originates from a gno program.
224
+ type Exception struct {
225
+ // Value is the value passed to panic.
226
+ Value TypedValue
227
+ // Frame is used to reference the frame a panic occurred in so that recover() knows if the
228
+ // currently executing deferred function is able to recover from the panic.
229
+ Frame * Frame
230
+
231
+ Stacktrace Stacktrace
232
+ }
233
+
234
+ func (e Exception ) Sprint (m * Machine ) string {
235
+ return e .Value .Sprint (m )
236
+ }
237
+
238
+ // UnhandledPanicError represents an error thrown when a panic is not handled in the realm.
239
+ type UnhandledPanicError struct {
240
+ Descriptor string // Description of the unhandled panic.
241
+ }
242
+
243
+ func (e UnhandledPanicError ) Error () string {
244
+ return e .Descriptor
245
+ }
Original file line number Diff line number Diff line change @@ -16,30 +16,6 @@ import (
16
16
"github.com/gnolang/gno/tm2/pkg/store"
17
17
)
18
18
19
- // Exception represents a panic that originates from a gno program.
20
- type Exception struct {
21
- // Value is the value passed to panic.
22
- Value TypedValue
23
- // Frame is used to reference the frame a panic occurred in so that recover() knows if the
24
- // currently executing deferred function is able to recover from the panic.
25
- Frame * Frame
26
-
27
- Stacktrace Stacktrace
28
- }
29
-
30
- func (e Exception ) Sprint (m * Machine ) string {
31
- return e .Value .Sprint (m )
32
- }
33
-
34
- // UnhandledPanicError represents an error thrown when a panic is not handled in the realm.
35
- type UnhandledPanicError struct {
36
- Descriptor string // Description of the unhandled panic.
37
- }
38
-
39
- func (e UnhandledPanicError ) Error () string {
40
- return e .Descriptor
41
- }
42
-
43
19
//----------------------------------------
44
20
// Machine
45
21
You can’t perform that action at this time.
0 commit comments