1#![allow(clippy::result_large_err)]
2
3pub mod command;
4pub mod crossplane;
5pub mod github;
6pub mod kubernetes;
7pub mod okta;
8
9#[derive(Debug, thiserror::Error, miette::Diagnostic)]
10#[error(transparent)]
11#[allow(clippy::large_enum_variant)]
12#[remain::sorted]
13#[non_exhaustive]
14pub enum Error {
15 Client(#[from] eio_okta_client::Error),
16 FancyRegex(#[from] fancy_regex::Error),
17 Inquire(#[from] inquire::error::InquireError),
18 IO(#[from] std::io::Error),
19 IriStringTemplate(#[from] iri_string::template::Error),
20 IriStringValidate(#[from] iri_string::validate::Error),
21 Json(#[from] serde_json::Error),
22 #[error("missing github access token")]
23 MissingGithubAccessToken,
24 Octocrab(#[from] octocrab::Error),
25 Yaml(#[from] serde_yml::Error),
26}
27
28pub trait MapInto<T, E> {
29 fn map_into(self) -> Result<T, E>;
30}
31
32impl<OkFrom, ErrFrom, OkInto, ErrInto> MapInto<OkInto, ErrInto> for Result<OkFrom, ErrFrom>
33where
34 OkFrom: Into<OkInto>,
35 ErrFrom: Into<ErrInto>,
36{
37 fn map_into(self) -> Result<OkInto, ErrInto> {
38 self.map(Into::into).map_err(Into::into)
39 }
40}