Skip to content

Commit 3eef62d

Browse files
authored
log errors (#5139)
1 parent e2a244b commit 3eef62d

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/state/queries/video/video.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,16 @@ export function useUploadVideo({
123123
blobRef,
124124
})
125125
},
126-
onError: useCallback(() => {
127-
dispatch({
128-
type: 'SetError',
129-
error: _(msg`Video failed to process`),
130-
})
131-
}, [_]),
126+
onError: useCallback(
127+
error => {
128+
logger.error('Error processing video', {safeMessage: error})
129+
dispatch({
130+
type: 'SetError',
131+
error: _(msg`Video failed to process`),
132+
})
133+
},
134+
[_],
135+
),
132136
})
133137

134138
const {mutate: onVideoCompressed} = useUploadVideoMutation({
@@ -140,6 +144,7 @@ export function useUploadVideo({
140144
setJobId(response.jobId)
141145
},
142146
onError: e => {
147+
logger.error('Error uploading video', {safeMessage: e})
143148
if (e instanceof ServerError) {
144149
dispatch({
145150
type: 'SetError',
@@ -171,6 +176,7 @@ export function useUploadVideo({
171176
onVideoCompressed(video)
172177
},
173178
onError: e => {
179+
logger.error('Error uploading video', {safeMessage: e})
174180
if (e instanceof VideoTooLargeError) {
175181
dispatch({
176182
type: 'SetError',

0 commit comments

Comments
 (0)