feat(meta): add error handling for meta.json blossom operations
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 45s
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 45s
This commit is contained in:
parent
3d1bdece4d
commit
7007492a0d
@ -868,11 +868,11 @@ export const CreatePage = () => {
|
||||
|
||||
setLoadingSpinnerDesc('Updating user app data')
|
||||
|
||||
const metaUrl = await uploadMetaToFileStorage(meta, encryptionKey)
|
||||
|
||||
const event = await updateUsersAppData(meta)
|
||||
if (!event) return
|
||||
|
||||
const metaUrl = await uploadMetaToFileStorage(meta, encryptionKey)
|
||||
|
||||
setLoadingSpinnerDesc('Sending notifications to counterparties')
|
||||
const promises = sendNotifications({
|
||||
metaUrl,
|
||||
|
@ -753,7 +753,17 @@ export const SignPage = () => {
|
||||
return
|
||||
}
|
||||
|
||||
const metaUrl = await uploadMetaToFileStorage(meta, encryptionKey)
|
||||
let metaUrl: string | undefined
|
||||
try {
|
||||
metaUrl = await uploadMetaToFileStorage(meta, encryptionKey)
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
toast.error(error.message)
|
||||
}
|
||||
console.error(error)
|
||||
setIsLoading(false)
|
||||
return
|
||||
}
|
||||
|
||||
const userSet = new Set<`npub1${string}`>()
|
||||
if (submittedBy && submittedBy !== usersPubkey) {
|
||||
|
@ -949,8 +949,12 @@ const processReceivedEvent = async (event: Event, difficulty: number = 5) => {
|
||||
|
||||
encryptionKey = decrypted
|
||||
}
|
||||
|
||||
meta = await fetchMetaFromFileStorage(notification.metaUrl, encryptionKey)
|
||||
try {
|
||||
meta = await fetchMetaFromFileStorage(notification.metaUrl, encryptionKey)
|
||||
} catch (error) {
|
||||
console.error(`An error occured fetching meta file from storage`, error)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
meta = parsedContent
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user