Improve error messages from bad snapshots

This commit is contained in:
Lucien Greathouse
2019-02-27 00:47:02 -08:00
parent 93349ae2dc
commit 20be37dd8b
8 changed files with 83 additions and 24 deletions

View File

@@ -10,7 +10,7 @@ use crate::{
project::{Project, ProjectLoadFuzzyError},
web::LiveServer,
imfs::FsError,
live_session::LiveSession,
live_session::{LiveSession, LiveSessionError},
};
const DEFAULT_PORT: u16 = 34872;
@@ -28,11 +28,15 @@ pub enum ServeError {
#[fail(display = "{}", _0)]
FsError(#[fail(cause)] FsError),
#[fail(display = "{}", _0)]
LiveSessionError(#[fail(cause)] LiveSessionError),
}
impl_from!(ServeError {
ProjectLoadFuzzyError => ProjectLoadError,
FsError => FsError,
LiveSessionError => LiveSessionError,
});
pub fn serve(options: &ServeOptions) -> Result<(), ServeError> {