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:
Philip Molares 2020-04-12 20:43:38 +02:00 committed by David Mehren
parent 982bbe9728
commit 41726949e8
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB
2 changed files with 2 additions and 2 deletions

View file

@ -17,7 +17,7 @@ const FilesystemUploadProvider: UploadProvider = {
return
}
callback(null, (new URL(path.basename(imagePath), config.serverURL + '/uploads/')).href)
callback(undefined, (new URL(path.basename(imagePath), config.serverURL + '/uploads/')).href)
}
}

View file

@ -20,7 +20,7 @@ const ImgurUploadProvider: UploadProvider = {
imgur.uploadFile(imagePath)
.then(function (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) {
callback(new Error(err), undefined)
})