1
Fork 0

Fix typo bug in scanAlbum

This commit is contained in:
viktorstrate 2019-08-23 00:46:04 +02:00
parent 3c51a23a50
commit fa063d3363
2 changed files with 23 additions and 2 deletions

View File

@ -34,6 +34,15 @@ async function _execScan(scanner, scanFunction) {
},
})
scanner.pubsub.publish(EVENT_SCANNER_PROGRESS, {
scannerStatusUpdate: {
progress: 0,
finished: false,
success: false,
message: 'Dummy error',
},
})
console.log('Calling scan function')
await scanFunction()
console.log('Scan function ended')
@ -52,6 +61,16 @@ async function _execScan(scanner, scanFunction) {
} photos`,
},
})
scanner.pubsub.publish(EVENT_SCANNER_PROGRESS, {
scannerStatusUpdate: {
progress: 0,
finished: false,
success: false,
message:
'Another dummy error, that is very long, and wraps multiple lines. Theirefore it is longer yay',
},
})
} catch (e) {
console.error(`SCANNER ERROR: ${e.message}\n${e.stack}`)
scanner.pubsub.publish(EVENT_SCANNER_PROGRESS, {

View File

@ -21,13 +21,15 @@ export default async function scanAlbum(scanner, album) {
processingImagePromises.push(
_processImage(scanner, photo.id).catch(e => {
console.error(`Error processing image (${e.path}): ${e.stack}`)
console.error(
`Error processing image (${JSON.stringify(photo)}): ${e.stack}`
)
scanner.pubsub.publish(EVENT_SCANNER_PROGRESS, {
scannerStatusUpdate: {
progress: 0,
finished: false,
success: false,
message: `Error processing image at ${e.path}: ${e.message}`,
message: `Error processing image at ${photo.path}: ${e.message}`,
},
})
})