Skip to content

Commit 1eac44c

Browse files
committed
minor cli error output fix
1 parent 45431b6 commit 1eac44c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/audioDataAnalyzer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ analyzer.prototype.getData = function getDataFunction(trackPath, callback) {
129129

130130
ffprobeSpawn.on('error', function(error) {
131131

132-
if (error === 'Error: spawn ENOENT') {
132+
if (error.code === 'ENOENT') {
133133

134134
callback('Unable to locate ffprobe, check it is installed and in the path');
135135

136136
} else {
137137

138-
callback(error);
138+
callback(error.syscall + ' ' + error.errno);
139139

140140
}
141141

@@ -328,13 +328,13 @@ analyzer.prototype.getPeaks = function getValuesFunction(trackPath, peaksAmountR
328328

329329
ffmpegSpawn.on('error', function(error) {
330330

331-
if (error === 'Error: spawn ENOENT') {
331+
if (error.code === 'ENOENT') {
332332

333333
callback('Unable to locate ffmpeg, check it is installed and in the path');
334334

335335
} else {
336336

337-
callback(error);
337+
callback(error.syscall + ' ' + error.errno);
338338

339339
}
340340

0 commit comments

Comments
 (0)