Mercurial > public > mercurial-scm > hg-stable
comparison rust/hg-core/src/errors.rs @ 46511:43d63979a75e
rust: use HgError in RevlogError and Vfs
Differential Revision: https://phab.mercurial-scm.org/D9897
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Wed, 27 Jan 2021 14:45:25 +0100 |
parents | 39e9407820ac |
children | d03b0601e0eb |
comparison
equal
deleted
inserted
replaced
46510:02d3bb972121 | 46511:43d63979a75e |
---|---|
33 CurrentDir, | 33 CurrentDir, |
34 } | 34 } |
35 | 35 |
36 impl HgError { | 36 impl HgError { |
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 | |
39 // to aid debugging? | |
40 // https://doc.rust-lang.org/std/backtrace/struct.Backtrace.html | |
38 HgError::CorruptedRepository(explanation.into()) | 41 HgError::CorruptedRepository(explanation.into()) |
39 } | 42 } |
40 } | 43 } |
41 | 44 |
42 // TODO: use `DisplayBytes` instead to show non-Unicode filenames losslessly? | 45 // TODO: use `DisplayBytes` instead to show non-Unicode filenames losslessly? |