mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 21:20:17 +00:00
introduce the use of anyhow to no longer use panic
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
use crate::config::EntryDeclaration;
|
||||
use crate::context::Context;
|
||||
use crate::context::SproutContext;
|
||||
use crate::generators::matrix::MatrixConfiguration;
|
||||
use anyhow::Result;
|
||||
use anyhow::bail;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::rc::Rc;
|
||||
|
||||
@@ -13,12 +15,12 @@ pub struct GeneratorDeclaration {
|
||||
}
|
||||
|
||||
pub fn generate(
|
||||
context: Rc<Context>,
|
||||
context: Rc<SproutContext>,
|
||||
generator: &GeneratorDeclaration,
|
||||
) -> Vec<(Rc<Context>, EntryDeclaration)> {
|
||||
) -> Result<Vec<(Rc<SproutContext>, EntryDeclaration)>> {
|
||||
if let Some(matrix) = &generator.matrix {
|
||||
matrix::generate(context, matrix)
|
||||
} else {
|
||||
panic!("unknown action configuration");
|
||||
bail!("unknown action configuration");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user