Files
flipper/packer/src/error.rs
Pascal Hartig 8818fbe375 Build all artifacts from packlist
Summary:
Instead of hardcoding the targets, it will now build all specified
types in the "packlist".

Reviewed By: jknoxville

Differential Revision: D21349762

fbshipit-source-id: 58f4a3bbf0b6ff4dd87eb44bbd7b200127da8017
2020-05-01 09:43:17 -07:00

38 lines
1.0 KiB
Rust

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
use crate::types::{PackType, Platform};
use std::fmt;
use std::path::PathBuf;
#[derive(Debug)]
pub enum Error {
MissingPackFile(Platform, PackType, PathBuf),
MissingPlatformDefinition(Platform),
}
impl std::error::Error for Error {}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Error::MissingPackFile(platform, pack_type, path) => write!(
f,
"Couldn't open file to pack for platform {:?} and type {:?}: {}",
platform,
pack_type,
path.to_string_lossy()
),
Error::MissingPlatformDefinition(platform) => write!(
f,
"Platform {} is not defined in the given packlist.",
platform
),
}
}
}