JavaScript is disabled, refresh for a better experience. ambee/giterated

ambee/giterated

Git repository hosting, collaboration, and discovery for the Fediverse.

Return error instead of panic

Emilia - ⁨1⁩ year ago

parent: tbd commit: ⁨27a2f7f

Showing ⁨⁨1⁩ changed file⁩ with ⁨⁨2⁩ insertions⁩ and ⁨⁨4⁩ deletions⁩

giterated-stack/src/substack.rs

View file
@@ -3,7 +3,7 @@ use std::{collections::HashMap, marker::PhantomData, sync::Arc};
3 3 use anyhow::Error;
4 4 use futures_util::FutureExt;
5 5 use giterated_models::{
6 error::OperationError,
6 error::{IntoInternalError, OperationError},
7 7 instance::Instance,
8 8 object::{GiteratedObject, ObjectRequest, ObjectResponse},
9 9 operation::GiteratedOperation,
@@ -293,9 +293,7 @@ impl<S: Send + Sync + Clone + 'static> SubstackBuilder<S, StackOperationState> {
293 293 .await
294 294 {
295 295 Ok(setting) => Ok(AnyValue::new(setting)),
296 Err(err) => {
297 panic!("Error: {:?}", err);
298 }
296 Err(err) => Err(err).as_internal_error(),
299 297 }
300 298 }
301 299 .boxed_local()