mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-23 18:26:32 -05:00
not specified errors should be undefined and not null in UploadProvider
Signed-off-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
parent
982bbe9728
commit
41726949e8
2 changed files with 2 additions and 2 deletions
|
@ -17,7 +17,7 @@ const FilesystemUploadProvider: UploadProvider = {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(null, (new URL(path.basename(imagePath), config.serverURL + '/uploads/')).href)
|
callback(undefined, (new URL(path.basename(imagePath), config.serverURL + '/uploads/')).href)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ const ImgurUploadProvider: UploadProvider = {
|
||||||
imgur.uploadFile(imagePath)
|
imgur.uploadFile(imagePath)
|
||||||
.then(function (json) {
|
.then(function (json) {
|
||||||
logger.debug(`SERVER uploadimage success: ${JSON.stringify(json)}`)
|
logger.debug(`SERVER uploadimage success: ${JSON.stringify(json)}`)
|
||||||
callback(null, json.data.link.replace(/^http:\/\//i, 'https://'))
|
callback(undefined, json.data.link.replace(/^http:\/\//i, 'https://'))
|
||||||
}).catch(function (err) {
|
}).catch(function (err) {
|
||||||
callback(new Error(err), undefined)
|
callback(new Error(err), undefined)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue