blob: 22a5d486a1112be7586641c137e2654fc873a921 [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),
}
impl From<anyhow::Error> for PowerManagerError {
fn from(e: anyhow::Error) -> Self {
PowerManagerError::GenericError(e)
}
}