blob: c2e8b9fe8e926db74fc9256b7b331d2292898bef [file] [log] [blame]
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#[derive(thiserror::Error, Debug)]
pub enum PowerManagerError {
#[error("Error: {}", .0)]
GenericError(anyhow::Error),
#[error("Operation not supported")]
Unsupported,
#[error("Invalid argument")]
InvalidArgument(String),
#[error("Out of space")]
OutOfSpace(String),
#[error("Busy")]
Busy(String),
}
impl From<anyhow::Error> for PowerManagerError {
fn from(e: anyhow::Error) -> Self {
PowerManagerError::GenericError(e)
}
}