Skip to content

ch9.2 : outdated error quoted #1262

Closed
Closed
@ghost

Description

seen here https://doc.rust-lang.org/stable/book/second-edition/ch09-02-recoverable-errors-with-result.html EDIT: or scroll up 4 lines from this: https://doc.rust-lang.org/stable/book/second-edition/ch09-02-recoverable-errors-with-result.html#matching-on-different-errors
as:

thread 'main' panicked at 'There was a problem opening the file: Error { repr:
Os { code: 2, message: "No such file or directory" } }', src/main.rs:9:12

but actual error, currently, is:

thread 'main' panicked at 'There was a problem opening the file: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/main.rs:9:13

diff:

--- inbook	2018-04-01 11:48:07.607884299 +0200
+++ shouldbe	2018-04-01 11:48:12.349824685 +0200
@@ -1,2 +1,2 @@
-thread 'main' panicked at 'There was a problem opening the file: Error { repr: Os { code: 2, message: "No such file or directory" } }', src/main.rs:9:12
+thread 'main' panicked at 'There was a problem opening the file: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/main.rs:9:13
 

screenshot:
untitled

Side note:

The error doesn't include the name of the file, so I imagine this will be hell to track down if the error is just propagated upwards. Oh actually, I do remember one example I've encountered: lukaslueg/built#14

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions