Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn more instead of erroring #4302

Merged
merged 1 commit into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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