Skip to content

Commit

Permalink
Warn more instead of erroring (#4302)
Browse files Browse the repository at this point in the history
  • Loading branch information
arturi committed Feb 9, 2023
1 parent a0a7d4b commit 7c9e166
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/@uppy/audio/src/Audio.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export default class Audio extends UIPlugin {
} catch (err) {
// Logging the error, exept restrictions, which is handled in Core
if (!err.isRestriction) {
this.uppy.log(err, 'error')
this.uppy.log(err, 'warning')
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/core/src/Uppy.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class Uppy {
this.emit('error', error)
}
this.info({ message, details }, 'error', this.opts.infoTimeout)
this.log(`${message} ${details}`.trim(), 'error')
this.log(error, 'warning')
}

validateRestrictions (file, files = this.getFiles()) {
Expand Down
5 changes: 1 addition & 4 deletions packages/@uppy/dashboard/src/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,8 @@ export default class Dashboard extends UIPlugin {
// Emits first event on initialization.
this.resizeObserver = new ResizeObserver((entries) => {
const uppyDashboardInnerEl = entries[0]

const { width, height } = uppyDashboardInnerEl.contentRect

this.uppy.log(`[Dashboard] resized: ${width} / ${height}`, 'debug')

this.setPluginState({
containerWidth: width,
containerHeight: height,
Expand All @@ -430,7 +427,7 @@ export default class Dashboard extends UIPlugin {
// and it's not due to the modal being closed
&& !isModalAndClosed
) {
this.uppy.log("[Dashboard] resize event didn't fire on time: defaulted to mobile layout", 'debug')
this.uppy.log('[Dashboard] resize event didnt fire on time: defaulted to mobile layout', 'warning')

this.setPluginState({
areInsidesReadyToBeVisible: true,
Expand Down
6 changes: 3 additions & 3 deletions packages/@uppy/screen-capture/src/ScreenCapture.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default class ScreenCapture extends UIPlugin {

install () {
if (!isScreenRecordingSupported()) {
this.uppy.log('Screen recorder access is not supported', 'error')
this.uppy.log('Screen recorder access is not supported', 'warning')
return null
}

Expand Down Expand Up @@ -192,8 +192,8 @@ export default class ScreenCapture extends UIPlugin {
.catch((err) => {
if (err.name === 'NotAllowedError') {
this.uppy.info(this.i18n('micDisabled'), 'error', 5000)
this.uppy.log(this.i18n('micDisabled'), 'warning')
}

return false
})
}
Expand Down Expand Up @@ -316,7 +316,7 @@ export default class ScreenCapture extends UIPlugin {
} catch (err) {
// Logging the error, exept restrictions, which is handled in Core
if (!err.isRestriction) {
this.uppy.log(err, 'error')
this.uppy.log(err, 'warning')
}
}
}
Expand Down

0 comments on commit 7c9e166

Please sign in to comment.