I am new to promises and am probably doing something wrong. I am making a backup of a MongoDB instance using Mongodump. Everything works fine, however I got a slight problem with the stacktrace. In a function, that should be awaited using async/await in the main process I am creating a new promise. At the end of the function I am calling (Cut out the beginning):

```
backupDB(collection) {
    return new Promise((resolve, reject) => {
        let backupLog = [];
        backupLog.push({
            time: moment(),
            msg: `Backup for ${collection} started`
        });            

        let spawnArguments = [
            '--host', 'localhost',
            '--port', portProd,
            '--collection', collection,
            '--db', dbNameProd,
            '--out', dumpPath
        ];

        const spawnprocess = spawn(mongodumpPath, spawnArguments,
            {shell: true}
        );

        spawnprocess.on('close', (code) => {
            if (code === 0) {
                backupLog.push({
                    time: moment(),
                    msg: `Backup for ${collection} finished`
                });                
                resolve(backupLog);
            } else {
                backupLog.push({
                    time: moment(),
                    msg: `Backup for ${collection} failed`
                }); 
                reject(backupLog);
            }
        });

```

The variable mongodumpPath is deliberately not defined (for the sake of demonstraion), but when I run the function inside a try catch, no error is thrown:

```
    try {
        log = log.concat(await this.backupDB('ops', {regDate: {$gte: {$date: fromDate}, $lte: {$date: toDate}}})); 

    } catch (e) {
        log = log.concat(e);
        return log;
    }

```

If I call 

```
this.backupDB('ops', {regDate: {$gte: {$date: fromDate}, $lte: {$date: toDate}}})

```

a stacktrace is thrown in the console. I guess this is due to me only rejecting the error, when spawnprocess is emitting a close event. The program crashes before though, so how can I catch that?

Thanks a lot! :)