Conversation
# Conflicts: # packages/shared/src/lib/featureManagement.ts
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@claude make sure all circleCI is happy and green |
|
Claude finished @rebelchris's task in 35m 36s —— View job Checking CircleCI Status
|
| } catch { | ||
| return { error: fallbackError } as BetterAuthResult<T>; | ||
| } |
There was a problem hiding this comment.
should we add some logging with logEvent error for catch in this file?
There was a problem hiding this comment.
Claude says:
⏺ Looking at the file, the only catch block (line 38) handles JSON parse failures on error responses. A few considerations:
- This is a plain utility file, not a React component — it doesn't have access to useLogContext(), so you'd need to either pass a logger in or import a non-React logging mechanism.
- The catch is narrow and expected — it fires when an error response has a non-JSON body. The caller already gets the fallbackError string, so it's not a silent failure.
- It's a fetch-level concern — API errors are typically better logged at the call site (the component/hook) where you have context about what the user was doing.
Adding logging here would add coupling for minimal benefit. If you're seeing issues where API errors go unnoticed, a better approach would be logging at the call sites where you have access to LogContext and
can include meaningful context (e.g., which action failed, user state).
That said, if you want lightweight visibility without React context, a console.warn in the catch would be low-cost:
} catch (e) {
console.warn('Failed to parse error response:', path, e);
return { error: fallbackError } as BetterAuthResult;
}
But I'd lean toward no change — the current behavior is fine for a startup moving fast. Want me to add anything?
There was a problem hiding this comment.
was just thinking to be aware of issues happening, maybe we can log these on server side since it goes through API?

Changes
Events
Did you introduce any new tracking events?
Experiment
Did you introduce any new experiments?
Manual Testing
Caution
Please make sure existing components are not breaking/affected by this PR
Preview domain
https://feat-better-auth.preview.app.daily.dev