File tree Expand file tree Collapse file tree 1 file changed +37
-1
lines changed Expand file tree Collapse file tree 1 file changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -202,10 +202,46 @@ Please note that *ALL* deprecated features will be removed at the release
202
202
of Perl 6.0.0 (expected sometime in 2015).
203
203
= end code
204
204
205
+ = head2 trait is hidden_from_backtrace
206
+
207
+ multi sub trait_mod:<is>(Routine:D, :$hidden_from_backtrace!)
208
+
209
+ Hides a routine from showing up in a default backtrace. For example
210
+
211
+ = begin code
212
+ sub inner { die "OH NOEZ" };
213
+ sub outer { inner() };
214
+ outer();
215
+ = end code
216
+
217
+ produces the error message and backtrace
218
+
219
+ = begin code
220
+ OH NOEZ
221
+ in sub inner at bt.p6:1
222
+ in sub outer at bt.p6:2
223
+ in block <unit> at bt.p6:3
224
+ = end code
225
+
226
+ but if C < inner > is marked with C < hidden_from_backtrace >
227
+
228
+ = begin code
229
+ sub inner is hidden_from_backtrace { die "OH NOEZ" };
230
+ sub outer { inner() };
231
+ outer();
232
+ = end code
233
+
234
+ the error backtrace does not show it:
235
+
236
+ = begin code
237
+ OH NOEZ
238
+ in sub outer at bt.p6:2
239
+ in block <unit> at bt.p6:3
240
+ = end code
241
+
205
242
= begin comment
206
243
207
244
TODO: explain export tags
208
- TODO: traits hidden_from_backtrace
209
245
210
246
= end comment
211
247
You can’t perform that action at this time.
0 commit comments