From 6f9c78979d4d7de6d96f7ae651b2c2018fec6e5f Mon Sep 17 00:00:00 2001 From: dubiousjim Date: Fri, 3 Apr 2020 13:47:57 -0400 Subject: Properly handle invalid utf8 in paths (#4609) --- cli/op_error.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cli/op_error.rs') diff --git a/cli/op_error.rs b/cli/op_error.rs index 3537d4b28..1d6236c77 100644 --- a/cli/op_error.rs +++ b/cli/op_error.rs @@ -104,6 +104,10 @@ impl OpError { pub fn bad_resource_id() -> OpError { Self::new(ErrorKind::BadResource, "Bad resource ID".to_string()) } + + pub fn invalid_utf8() -> OpError { + Self::new(ErrorKind::InvalidData, "invalid utf8".to_string()) + } } impl Error for OpError {} -- cgit v1.2.3