Migrate to thiserror (#7177)

* Migrate to thiserror

* Discourage the use of other modules' Result alias

`io::Result` set a bad precedent. Don't import other `Result`
aliases.
This commit is contained in:
Greg Fitzgerald
2019-12-02 15:42:05 -07:00
committed by GitHub
parent f9df17d8d0
commit 6796b08909
20 changed files with 122 additions and 146 deletions

View File

@@ -18,6 +18,7 @@ serde = "1.0.103"
serde_derive = "1.0.103"
solana-sdk = { path = "../../sdk", version = "0.22.0" }
solana-config-program = { path = "../config", version = "0.22.0" }
thiserror = "1.0"
[dev-dependencies]
solana-runtime = { path = "../../runtime", version = "0.22.0" }

View File

@@ -9,10 +9,14 @@ use solana_sdk::{
pubkey::Pubkey,
system_instruction,
};
use thiserror::Error;
#[derive(Debug, Clone, PartialEq, FromPrimitive)]
#[derive(Error, Debug, Clone, PartialEq, FromPrimitive)]
pub enum VestError {
#[error("destination missing")]
DestinationMissing,
#[error("unauthorized")]
Unauthorized,
}