Squash errors in case of mkdir trying to create an existing directory (need mkdirp, but this works without an extra module)

This commit is contained in:
sixteenmillimeter 2020-07-26 22:01:28 -04:00
parent 8c97258866
commit 0c364576c9
5 changed files with 19 additions and 5 deletions

View File

@ -201,7 +201,12 @@ class FFMPEG {
await fs_extra_1.mkdir(tmppath); await fs_extra_1.mkdir(tmppath);
} }
catch (err) { catch (err) {
this.log.error(err); if (err.code && err.code === 'EEXIST') {
//directory exists
}
else {
this.log.error(err);
}
} }
//ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "${tmpoutput}" //ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {

File diff suppressed because one or more lines are too long

View File

@ -201,7 +201,12 @@ class FFMPEG {
await fs_extra_1.mkdir(tmppath); await fs_extra_1.mkdir(tmppath);
} }
catch (err) { catch (err) {
this.log.error(err); if (err.code && err.code === 'EEXIST') {
//directory exists
}
else {
this.log.error(err);
}
} }
//ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "${tmpoutput}" //ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {

File diff suppressed because one or more lines are too long

View File

@ -249,7 +249,11 @@ class FFMPEG {
try { try {
await mkdir(tmppath); await mkdir(tmppath);
} catch (err) { } catch (err) {
this.log.error(err); if (err.code && err.code === 'EEXIST') {
//directory exists
} else {
this.log.error(err);
}
} }
//ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "${tmpoutput}" //ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"