Skip to content
Snippets Groups Projects
Commit 7a606370 authored by Yogmatee Roochun's avatar Yogmatee Roochun
Browse files

solved issues with email, manuscript status change, erroneaous files on ftp

parent aad4602a
No related branches found
No related tags found
2 merge requests!110Dev,!109Shared data model
......@@ -39,13 +39,17 @@ const watcher = chokidar.watch(`${rootPath}**/*.tar.gz`, {
},
})
process.on('uncaughtException', err => {
if (err.submitter) {
bulkUploaderEmail(err.submitter.email, err.message)
}
errorDevEmail(err)
logger.error('whoops! there was an error', err.stack)
})
process
.on('uncaughtException', err => {
if (err.submitter) {
bulkUploaderEmail(err.submitter.email, err.message)
}
errorDevEmail(err)
logger.error('whoops! there was an error', err.stack)
})
.on('unhandledRejection', reason => {
logger.error(`Unhandled Rejection at: ${reason.stack || reason}`)
})
watcher
.on('add', path => logger.debug(`File ${path} has been added.`))
......
......@@ -298,11 +298,15 @@ function compress(tmpPath, manuscript, datedFolder) {
})
}
process.on('uncaughtException', err => {
errorDevEmail(err)
logger.error('whoops! there was an error', err.stack)
// tidyUp()
})
process
.on('uncaughtException', err => {
errorDevEmail(err)
logger.error('whoops! there was an error', err.stack)
// tidyUp()
})
.on('unhandledRejection', reason => {
logger.error(`Unhandled Rejection at: ${reason.stack || reason}`)
})
function tidyUp(tmpPath) {
try {
......
......@@ -131,7 +131,6 @@ module.exports.moveErroneousFile = function moveErroneousFile(
) {
return new Promise((resolve, reject) => {
const filename = path.basename(filepath)
const oldPath = filepath
const newPath = `${errorFolder}/${filename}_${Date.now()}`
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment