Port from Failure to Snafu (#281)

* Failure -> Snafu for build command

* Port skeletal remains of init to snafu

* failure -> snafu for serve

* failure -> snafu for upload, remove impl_from macro

* failure -> custom error in vfs

* Bye bye, failure

* Fix Rust 1.36 build regression
This commit is contained in:
Lucien Greathouse
2019-12-18 15:44:46 -08:00
committed by GitHub
parent 41396367ac
commit 1b9e90e786
10 changed files with 99 additions and 104 deletions

View File

@@ -1,17 +1,17 @@
use failure::Fail;
use snafu::Snafu;
use crate::{cli::InitCommand, project::ProjectError};
use crate::cli::InitCommand;
#[derive(Debug, Fail)]
pub enum InitError {
#[fail(display = "Project init error: {}", _0)]
ProjectError(#[fail(cause)] ProjectError),
#[derive(Debug, Snafu)]
pub struct InitError(Error);
#[derive(Debug, Snafu)]
enum Error {}
pub fn init(options: InitCommand) -> Result<(), InitError> {
Ok(init_inner(options)?)
}
impl_from!(InitError {
ProjectError => ProjectError,
});
pub fn init(_options: InitCommand) -> Result<(), InitError> {
fn init_inner(_options: InitCommand) -> Result<(), Error> {
unimplemented!("init command");
}