make hooks return a result instead of an option

This commit is contained in:
Adrian Wannenmacher committed 2022-12-13 11:09:24 +01:00
1 parent 3e86c0e364
commit 7d2466ff28
5 files changed
+35 -26

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
/// Errors that may occur during routing.
#[derive(Debug, thiserror::Error)]
pub enum RouterError {
/// A hook that needs access to a router was called inside a component, that has no parent
/// calling the [`use_router`](crate::hooks::use_router) hook.
#[error("component needing access not inside router")]
NotInsideRouter,
}