Merge pull request #1544 from hedgedoc/fix/stop-swollowing-errors
fix(image-upload): Fix swallowing of errors for filesystem
This commit is contained in:
commit
277a2424bc
@ -22,7 +22,7 @@ exports.uploadImage = function (imagePath, callback) {
|
|||||||
try {
|
try {
|
||||||
fs.copyFileSync(imagePath, path.join(config.uploadsPath, fileName))
|
fs.copyFileSync(imagePath, path.join(config.uploadsPath, fileName))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
callback(new Error('Error while moving file'), null)
|
callback(new Error(`Error while moving file: ${e.message}`), null)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
callback(null, (new URL(fileName, config.serverURL + '/uploads/')).href)
|
callback(null, (new URL(fileName, config.serverURL + '/uploads/')).href)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user