Skip to content

Commit

Permalink
feat-#247: poll log in development
Browse files Browse the repository at this point in the history
  • Loading branch information
Baroshem committed Nov 5, 2024
1 parent 65529e9 commit ae1639a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/runtime/components/CldImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,16 @@ const handleError = async (payload: Event) => {
const eventPayload = payload.target as EventTarget & { src: string }
const result = await pollForProcessingImage(eventPayload)
if (result) imgKey.value = `${imgKey.value}-${Math.random()}`
if (
typeof result.error === 'string'
&& process.env.NODE_ENV === 'development'
) {
console.error(
`[CldImage] Failed to load image ${props.src}: ${result.error}`,
)
}
if (result.success) imgKey.value = `${imgKey.value}-${Math.random()}`
}
</script>

Expand Down

0 comments on commit ae1639a

Please sign in to comment.