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
@@ -97,7 +97,7 @@ impl Scope {
|
||||
}
|
||||
|
||||
fn sender(&self) -> futures_channel::mpsc::UnboundedSender<SchedulerMsg> {
|
||||
Runtime::with(|rt| rt.sender.clone()).unwrap()
|
||||
Runtime::with(|rt| rt.sender.clone()).unwrap_or_else(|e| panic!("{}", e))
|
||||
}
|
||||
|
||||
/// Mount the scope and queue any pending effects if it is not already mounted
|
||||
@@ -531,7 +531,9 @@ impl ScopeId {
|
||||
/// Run a closure inside of scope's runtime
|
||||
#[track_caller]
|
||||
pub fn in_runtime<T>(self, f: impl FnOnce() -> T) -> T {
|
||||
Runtime::current().unwrap().on_scope(self, f)
|
||||
Runtime::current()
|
||||
.unwrap_or_else(|e| panic!("{}", e))
|
||||
.on_scope(self, f)
|
||||
}
|
||||
|
||||
/// Throw a [`CapturedError`] into a scope. The error will bubble up to the nearest [`ErrorBoundary`] or the root of the app.
|
||||
|
||||
Reference in new issue
Block a user