Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add some more logging (#2402)

* Add a few logs

* Report unknown create account errors separately

* Downgrade to warn

* Nvm

authored by

Eric Bailey and committed by
GitHub
2f6f27c4 d95972c9

+16 -10
+4 -8
src/state/session/index.tsx
··· 181 181 182 182 const createAccount = React.useCallback<ApiContext['createAccount']>( 183 183 async ({service, email, password, handle, inviteCode}: any) => { 184 - logger.debug( 185 - `session: creating account`, 186 - { 187 - service, 188 - handle, 189 - }, 190 - logger.DebugContext.session, 191 - ) 184 + logger.info(`session: creating account`, { 185 + service, 186 + handle, 187 + }) 192 188 track('Try Create Account') 193 189 194 190 const agent = new BskyAgent({service})
+7 -1
src/view/com/auth/create/state.ts
··· 136 136 msg`Invite code not accepted. Check that you input it correctly and try again.`, 137 137 ) 138 138 } 139 - logger.error('Failed to create account', {error: e}) 139 + 140 + if ([400, 429].includes(e.status)) { 141 + logger.warn('Failed to create account', {error: e}) 142 + } else { 143 + logger.error(`Failed to create account (${e.status} status)`, {error: e}) 144 + } 145 + 140 146 uiDispatch({type: 'set-processing', value: false}) 141 147 uiDispatch({type: 'set-error', value: cleanError(errMsg)}) 142 148 throw e
+5 -1
src/view/com/auth/login/LoginForm.tsx
··· 107 107 }) 108 108 } catch (e: any) { 109 109 const errMsg = e.toString() 110 - logger.warn('Failed to login', {error: e}) 111 110 setIsProcessing(false) 112 111 if (errMsg.includes('Authentication Required')) { 112 + logger.info('Failed to login due to invalid credentials', { 113 + error: errMsg, 114 + }) 113 115 setError(_(msg`Invalid username or password`)) 114 116 } else if (isNetworkError(e)) { 117 + logger.warn('Failed to login due to network error', {error: errMsg}) 115 118 setError( 116 119 _( 117 120 msg`Unable to contact your service. Please check your Internet connection.`, 118 121 ), 119 122 ) 120 123 } else { 124 + logger.warn('Failed to login', {error: errMsg}) 121 125 setError(cleanError(errMsg)) 122 126 } 123 127 }