Skip to content

Commit

Permalink
log errors (#5139)
Browse files Browse the repository at this point in the history
  • Loading branch information
mozzius authored Sep 4, 2024
1 parent e2a244b commit 3eef62d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/state/queries/video/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,16 @@ export function useUploadVideo({
blobRef,
})
},
onError: useCallback(() => {
dispatch({
type: 'SetError',
error: _(msg`Video failed to process`),
})
}, [_]),
onError: useCallback(
error => {
logger.error('Error processing video', {safeMessage: error})
dispatch({
type: 'SetError',
error: _(msg`Video failed to process`),
})
},
[_],
),
})

const {mutate: onVideoCompressed} = useUploadVideoMutation({
Expand All @@ -140,6 +144,7 @@ export function useUploadVideo({
setJobId(response.jobId)
},
onError: e => {
logger.error('Error uploading video', {safeMessage: e})
if (e instanceof ServerError) {
dispatch({
type: 'SetError',
Expand Down Expand Up @@ -171,6 +176,7 @@ export function useUploadVideo({
onVideoCompressed(video)
},
onError: e => {
logger.error('Error uploading video', {safeMessage: e})
if (e instanceof VideoTooLargeError) {
dispatch({
type: 'SetError',
Expand Down

0 comments on commit 3eef62d

Please sign in to comment.