Follow-up for error messages in core (#2719)
* Fix tests * Replace unwraps on RuntimeError with panics and add track_caller for better error output * Convert more unwraps * Fix git
This commit is contained in:
1 parent
a1dfc4b4f0
commit
6558fd95a2
9 files changed
+39
-17
No files matched your search
@@ -41,7 +41,12 @@ impl Error for CapturedPanic {}
|
||||
|
||||
/// Provide an error boundary to catch errors from child components
|
||||
pub fn use_error_boundary() -> ErrorContext {
|
||||
use_hook(|| provide_context(ErrorContext::new(Vec::new(), current_scope_id().unwrap())))
|
||||
use_hook(|| {
|
||||
provide_context(ErrorContext::new(
|
||||
Vec::new(),
|
||||
current_scope_id().unwrap_or_else(|e| panic!("{}", e)),
|
||||
))
|
||||
})
|
||||
}
|
||||
|
||||
/// A trait for any type that can be downcast to a concrete type and implements Debug. This is automatically implemented for all types that implement Any + Debug.
|
||||
|
||||
Reference in new issue
Block a user