Initial qwen3 run with opencode
This commit is contained in:
25
error-handling.md
Normal file
25
error-handling.md
Normal file
@@ -0,0 +1,25 @@
|
||||
## Error Handling
|
||||
|
||||
Use try-except blocks to handle errors gracefully:
|
||||
|
||||
```yaml
|
||||
- name: Handle errors with rescue block
|
||||
shell: "invalid-command"
|
||||
register: result
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Display error message
|
||||
debug:
|
||||
msg: "Error occurred: {{ result.msg }}"
|
||||
when: result.failed
|
||||
|
||||
# Use rescue block for specific error handling:
|
||||
# - name: Task that may fail
|
||||
# shell: "some-command"
|
||||
# register: result
|
||||
#
|
||||
# - name: Handle failure
|
||||
# debug:
|
||||
# msg: "Failed task: {{ result.msg }}"
|
||||
# when: result.failed
|
||||
```
|
||||
Reference in New Issue
Block a user