diff options
author | dubiousjim <dubiousjim@gmail.com> | 2020-04-03 13:47:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-03 13:47:57 -0400 |
commit | 6f9c78979d4d7de6d96f7ae651b2c2018fec6e5f (patch) | |
tree | 1691693d86e7457109550da9662282a32c9eb0dc /cli/op_error.rs | |
parent | c5c3abc517a1729c2fcc0977bb1e792e06b7eb3c (diff) |
Properly handle invalid utf8 in paths (#4609)
Diffstat (limited to 'cli/op_error.rs')
-rw-r--r-- | cli/op_error.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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 {} |