snarkvm_debug/cli/errors.rs
1// Copyright (C) 2019-2023 Aleo Systems Inc.
2// This file is part of the snarkVM library.
3
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at:
7// http://www.apache.org/licenses/LICENSE-2.0
8
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#[derive(Debug, Error)]
16pub enum UpdaterError {
17 #[error("{}: {}", _0, _1)]
18 Crate(&'static str, String),
19
20 #[error("The current version {} is more recent than the release version {}", _0, _1)]
21 OldReleaseVersion(String, String),
22}
23
24impl From<self_update::errors::Error> for UpdaterError {
25 fn from(error: self_update::errors::Error) -> Self {
26 UpdaterError::Crate("self_update", error.to_string())
27 }
28}