3 ms·
Looks good! I don't know how I feel about using OK for anything but 200 responses though.
by dagurp 11y ago
Looks good! I don't know how I feel about using OK for anything but 200 responses though.
- jimktrains2 11y agoWell, 100- and 300- class respones aren't errors, but yeah, 400- and 500- might make more sense as Err. You could also look at it from another point-of-view. Ok() means that I am able to fully handle this request, even if it's an HTTP error code, and Err being "nope, don't know. Sorry bud".
- pc2g4d 11y ago`Ok` is a member of the Rust `Result` enum: https://doc.rust-lang.org/std/result/enum.Result.html https://doc.rust-lang.org/std/result/enum.Result.html (and `PencilResult` as well) Since it's integral to error handling in Rust you probably can't get away from it.