-
Notifications
You must be signed in to change notification settings - Fork 186
fix: log fetch failure #532
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -32,7 +32,10 @@ export function useUserSession(): UserSessionComposable { | |||||||||||||||||||||
| accept: 'application/json', | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| retry: false, | ||||||||||||||||||||||
| }).catch(() => null) | ||||||||||||||||||||||
| }).catch(reason => { | ||||||||||||||||||||||
| console.log('Failure on fetching session', reason) | ||||||||||||||||||||||
| return null | ||||||||||||||||||||||
|
Comment on lines
+35
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid logging raw fetch rejection objects. At Line 36, logging Suggested safer pattern- }).catch(reason => {
- console.log('Failure on fetching session', reason)
+ }).catch((reason) => {
+ const message = reason instanceof Error ? reason.message : String(reason)
+ if (import.meta.dev) {
+ console.error('Failure on fetching session:', message)
+ }
return null
})📝 Committable suggestion
Suggested change
🧰 Tools🪛 ESLint[error] 35-35: Expected parentheses around arrow function argument having a body with curly braces. ( 🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We may somewhat fix the issue by yielding |
||||||||||||||||||||||
| }) | ||||||||||||||||||||||
| if (!authReadyState.value) { | ||||||||||||||||||||||
| authReadyState.value = true | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix lint error for arrow function parentheses.
Line 35 currently violates
@stylistic/arrow-parens; this can fail lint/CI.Minimal lint fix
📝 Committable suggestion
🧰 Tools
🪛 ESLint
[error] 35-35: Expected parentheses around arrow function argument having a body with curly braces.
(
@stylistic/arrow-parens)🤖 Prompt for AI Agents
Source: Linters/SAST tools