Skip to content

Commit ba4a701

Browse files
Update panic.md
1 parent 6519525 commit ba4a701

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

docs/panic.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ is a hard crash type of panic, not a regular type
55
of error.
66

77
The `control.panic` implementation is written like this in the runtime.
8-
``` ts
8+
TypeScript: ``` ts
99
export function panic(code: number) {
1010
U.userError("PANIC! Code " + code) // throw a panic code to the problems pane
1111
}
12-
```
12+
13+
C++: ```
14+
void pxtrt::panic(int code) {
15+
soft_panic(code); // because this is a high level panic function, it calls the safe normal panic, not a hard crash panic
16+
}
17+
```

0 commit comments

Comments
 (0)