Skip to content

Commit 8e28659

Browse files
committed
Add input and output of cargo run after data txt file deleted to show error
1 parent d9c655d commit 8e28659

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

documentation2/B07-File-Handling.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,19 @@ If the operation does not proceed, we return a custom message: `could not remove
205205
206206
If the file `data.txt` is not found or cannot be removed, we encounter an error.
207207
208+
#### cargo run
209+
210+
```bash
211+
cargo run
212+
```
213+
214+
##### Output
215+
216+
```bash
217+
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.02s
218+
Running `target\debug\hello_world.exe`
219+
thread 'main' panicked at src/main.rs:5:33:
220+
could not remove file: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }
221+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
222+
error: process didn't exit successfully: `target\debug\hello_world.exe` (exit code: 101)
223+
```

0 commit comments

Comments
 (0)