We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c86288e commit b6c1a98Copy full SHA for b6c1a98
plugins/system-utility/api/system.utility.js
@@ -471,13 +471,23 @@ async function stopProfiler(processName) {
471
const errors = [];
472
473
// clear old files
474
- await new Promise(
475
- (res, rej) => countlyFs.gridfs.deleteAll(
476
- PROFILER_DIR,
477
- null,
478
- err => err ? rej(err) : res()
479
- )
480
- );
+ try {
+ await new Promise(
+ (res, rej) => countlyFs.gridfs.deleteAll(
+ PROFILER_DIR,
+ null,
+ err => err ? rej(err) : res()
+ )
481
+ );
482
+ }
483
+ catch (err) {
484
+ if (err.code === 26) { // NamespaceNotFound: thrown when there's no collection initially
485
+ // do nothing...
486
487
+ else {
488
+ throw err;
489
490
491
492
// coverage
493
try {
0 commit comments