appbaseio / appbaseio/reactivesearch

Catch 401 errors without throwing error when auth is not valid anymore

Open
#1,590 7 comments 5 reactions 0 assignees View on GitHub
feature
Dominant language
JavaScript
Stars
4.9k
Forks
478
PR merge metrics
No merged PRs in 30d

Description

When a search fails and returns 401 (let's say because the session is not valid anymore), Reactive Search throws an error. I would love to catch it to _not trigger an error_, since it just means the connection is lost. The problem in throwing an error is that it adds some mess the console and the bug trackers (eg: Sentry). For instance, I would love a clean way to catch the error then redirect the user to a auth. `onError` on components is too late since the error is already thrown.

I'm using v3.14.0 (React project)

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Start by reproducing a search with an expired session in the React project and trace where the 401 becomes a thrown error. Done means callers have a clean way to handle this authentication failure before it reaches the console or error tracking.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
authentication, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.