comparison rust/hg-core/src/errors.rs @ 46462:d03b0601e0eb

rhg: initial support for shared repositories Differential Revision: https://phab.mercurial-scm.org/D9941
author Simon Sapin <simon.sapin@octobus.net>
date Thu, 14 Jan 2021 13:04:12 +0100
parents 43d63979a75e
children 2845892dd489
comparison
equal deleted inserted replaced
46461:f3f4d1b7dc97 46462:d03b0601e0eb
37 pub fn corrupted(explanation: impl Into<String>) -> Self { 37 pub fn corrupted(explanation: impl Into<String>) -> Self {
38 // TODO: capture a backtrace here and keep it in the error value 38 // TODO: capture a backtrace here and keep it in the error value
39 // to aid debugging? 39 // to aid debugging?
40 // https://doc.rust-lang.org/std/backtrace/struct.Backtrace.html 40 // https://doc.rust-lang.org/std/backtrace/struct.Backtrace.html
41 HgError::CorruptedRepository(explanation.into()) 41 HgError::CorruptedRepository(explanation.into())
42 }
43
44 pub fn unsupported(explanation: impl Into<String>) -> Self {
45 HgError::UnsupportedFeature(explanation.into())
42 } 46 }
43 } 47 }
44 48
45 // TODO: use `DisplayBytes` instead to show non-Unicode filenames losslessly? 49 // TODO: use `DisplayBytes` instead to show non-Unicode filenames losslessly?
46 impl fmt::Display for HgError { 50 impl fmt::Display for HgError {