Improve error logging

This commit is contained in:
Paul Frazee 2023-01-02 21:39:15 -06:00
parent 6885fb2b41
commit 4eabc2d65a
49 changed files with 212 additions and 188 deletions

View file

@ -57,10 +57,7 @@ export function Component({}: {}) {
})
.catch(e =>
// an error here is not critical
store.log.error(
'Failed to update scene profile during creation',
e.toString(),
),
store.log.error('Failed to update scene profile during creation', e),
)
// follow the scene
await store.api.app.bsky.graph.follow
@ -78,10 +75,7 @@ export function Component({}: {}) {
)
.catch(e =>
// an error here is not critical
store.log.error(
'Failed to follow scene after creation',
e.toString(),
),
store.log.error('Failed to follow scene after creation', e),
)
Toast.show('Scene created')
store.shell.closeModal()
@ -94,7 +88,7 @@ export function Component({}: {}) {
} else if (e instanceof AppBskyActorCreateScene.HandleNotAvailableError) {
setError(`The handle "${handle}" is not available.`)
} else {
store.log.error('Failed to create scene', e.toString())
store.log.error('Failed to create scene', e)
setError(
'Failed to create the scene. Check your internet connection and try again.',
)

View file

@ -86,7 +86,7 @@ export const Component = observer(function Component({
Toast.show('Invite sent')
} catch (e: any) {
setError('There was an issue with the invite. Please try again.')
store.log.error('Failed to invite user to scene', e.toString())
store.log.error('Failed to invite user to scene', e)
}
}
const onPressUndo = async (subjectDid: string, assertionUri: string) => {
@ -100,7 +100,7 @@ export const Component = observer(function Component({
setCreatedInvites(_omit(createdInvites, [subjectDid]))
} catch (e: any) {
setError('There was an issue with the invite. Please try again.')
store.log.error('Failed to delete a scene invite', e.toString())
store.log.error('Failed to delete a scene invite', e)
}
}
@ -119,7 +119,7 @@ export const Component = observer(function Component({
Toast.show('Invite removed')
} catch (e: any) {
setError('There was an issue with the invite. Please try again.')
store.log.error('Failed to delete an invite', e.toString())
store.log.error('Failed to delete an invite', e)
}
}