Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interceptor workflow #110

Open
cheezyde opened this issue Jan 15, 2025 · 0 comments
Open

Interceptor workflow #110

cheezyde opened this issue Jan 15, 2025 · 0 comments

Comments

@cheezyde
Copy link

Hi!

I’ve been trying out your library for almost two months now (loving it so far), but I’m having a hard time understanding the purpose of interceptors. I currently have a deep link and two other access points that should lead to a specific screen. I’m trying to use an interceptor to check if the screen is in a working state (e.g., the backend might be down). If it isn’t, I want the user to stay on the screen they were on before the navigation attempt, with a simple error window showing up—nothing more.

I’m using:
completion(.failure(RoutingError.generic(.init("Service is unavailible")))).

What makes me wonder if I am doing things right is the fact that
assertionFailure("Navigation is unsuccessful: \(error)")
stops the app from running in debug mode. It almost feels like I’ve misunderstood the purpose of interceptors entirely.

I’d love a brief explanation of this part! At this point, I’m considering removing assertionFailure() altogether, but I’m not entirely sure if that’s a good idea. :c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant