mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-25 11:14:05 +00:00
@uppy/companion-client: fix log type error (#4766)
* fix logging bug * Update Provider.js
This commit is contained in:
parent
a67f0ffdf2
commit
9699e58b5a
1 changed files with 11 additions and 1 deletions
|
|
@ -111,7 +111,17 @@ export default class Provider extends RequestClient {
|
|||
const authWindow = window.open(link, '_blank')
|
||||
const handleToken = (e) => {
|
||||
if (e.source !== authWindow) {
|
||||
this.uppy.log.warn('ignoring event from unknown source', e)
|
||||
let jsonData = ''
|
||||
try {
|
||||
// TODO improve our uppy logger so that it can take an arbitrary number of arguments,
|
||||
// each either objects, errors or strings,
|
||||
// then we don’t have to manually do these things like json stringify when logging.
|
||||
// the logger should never throw an error.
|
||||
jsonData = JSON.stringify(e.data)
|
||||
} catch (err) {
|
||||
// in case JSON.stringify fails (ignored)
|
||||
}
|
||||
this.uppy.log(`ignoring event from unknown source ${jsonData}`, 'warning')
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue