Skip to content

Commit cfccf41

Browse files
miharpclaude
andcommitted
Make the Error selector example self-contained
The selector snippet referenced $err without defining it, leaving the example inconsistent with the $e defined in the block above it. Define the variable in the snippet and notice the result so the example can be run on its own. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Michael Harp <mike@mikeharp.com>
1 parent 39f18d9 commit cfccf41

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

docs/_openvox_8x/lang_data_error.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,15 @@ This makes `Error` useful for sorting errors by category, for example in a [case
8989
that handles each `kind` differently:
9090

9191
```puppet
92+
$err = Error('Config file missing', 'mymod/config')
93+
9294
$handled = $err ? {
9395
Error['mymod/config'] => 'config problem',
9496
Error['mymod/network'] => 'network problem',
9597
default => 'unknown problem',
9698
}
99+
100+
notice($handled) # config problem
97101
```
98102

99103
### Examples

0 commit comments

Comments
 (0)