Implement logging system
This commit is contained in:
@@ -55,7 +55,13 @@ export function Component({}: {}) {
|
||||
displayName,
|
||||
description,
|
||||
})
|
||||
.catch(e => console.error(e)) // an error here is not critical
|
||||
.catch(e =>
|
||||
// an error here is not critical
|
||||
store.log.error(
|
||||
'Failed to update scene profile during creation',
|
||||
e.toString(),
|
||||
),
|
||||
)
|
||||
// follow the scene
|
||||
await store.api.app.bsky.graph.follow
|
||||
.create(
|
||||
@@ -70,7 +76,13 @@ export function Component({}: {}) {
|
||||
createdAt: new Date().toISOString(),
|
||||
},
|
||||
)
|
||||
.catch(e => console.error(e)) // an error here is not critical
|
||||
.catch(e =>
|
||||
// an error here is not critical
|
||||
store.log.error(
|
||||
'Failed to follow scene after creation',
|
||||
e.toString(),
|
||||
),
|
||||
)
|
||||
Toast.show('Scene created')
|
||||
store.shell.closeModal()
|
||||
store.nav.navigate(`/profile/${fullHandle}`)
|
||||
@@ -82,7 +94,7 @@ export function Component({}: {}) {
|
||||
} else if (e instanceof AppBskyActorCreateScene.HandleNotAvailableError) {
|
||||
setError(`The handle "${handle}" is not available.`)
|
||||
} else {
|
||||
console.error(e)
|
||||
store.log.error('Failed to create scene', e.toString())
|
||||
setError(
|
||||
'Failed to create the scene. Check your internet connection and try again.',
|
||||
)
|
||||
|
||||
@@ -84,9 +84,9 @@ export const Component = observer(function Component({
|
||||
)
|
||||
setCreatedInvites({[follow.did]: assertionUri, ...createdInvites})
|
||||
Toast.show('Invite sent')
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
setError('There was an issue with the invite. Please try again.')
|
||||
console.error(e)
|
||||
store.log.error('Failed to invite user to scene', e.toString())
|
||||
}
|
||||
}
|
||||
const onPressUndo = async (subjectDid: string, assertionUri: string) => {
|
||||
@@ -98,9 +98,9 @@ export const Component = observer(function Component({
|
||||
rkey: urip.rkey,
|
||||
})
|
||||
setCreatedInvites(_omit(createdInvites, [subjectDid]))
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
setError('There was an issue with the invite. Please try again.')
|
||||
console.error(e)
|
||||
store.log.error('Failed to delete a scene invite', e.toString())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,9 +117,9 @@ export const Component = observer(function Component({
|
||||
...deletedPendingInvites,
|
||||
})
|
||||
Toast.show('Invite removed')
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
setError('There was an issue with the invite. Please try again.')
|
||||
console.error(e)
|
||||
store.log.error('Failed to delete an invite', e.toString())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user