From f7dc6cebad98180bb0c604bf94e5a17af41af2db Mon Sep 17 00:00:00 2001 From: jj Date: Fri, 15 Nov 2024 12:19:49 +0000 Subject: [PATCH] all: add space after catch --- api/src/processing/cookie/manager.js | 2 +- api/src/processing/services/youtube.js | 4 ++-- api/src/util/test.js | 4 ++-- web/src/lib/libav.ts | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api/src/processing/cookie/manager.js b/api/src/processing/cookie/manager.js index 7a47685d..6b647db5 100644 --- a/api/src/processing/cookie/manager.js +++ b/api/src/processing/cookie/manager.js @@ -27,7 +27,7 @@ const setupMain = async (cookiePath) => { cluster.broadcast({ cookies }); console.log(`${Green('[✓]')} cookies loaded successfully!`); - } catch(e) { + } catch (e) { console.error(`${Yellow('[!]')} failed to load cookies.`); console.error('error:', e); } diff --git a/api/src/processing/services/youtube.js b/api/src/processing/services/youtube.js index ae96ea0d..e63a21b2 100644 --- a/api/src/processing/services/youtube.js +++ b/api/src/processing/services/youtube.js @@ -124,7 +124,7 @@ export default async function(o) { dispatcher: o.dispatcher }) ); - } catch(e) { + } catch (e) { if (e.message?.endsWith("decipher algorithm")) { return { error: "youtube.decipher" } } else if (e.message?.includes("refresh access token")) { @@ -142,7 +142,7 @@ export default async function(o) { let info; try { info = await yt.getBasicInfo(o.id, useHLS ? 'IOS' : 'ANDROID'); - } catch(e) { + } catch (e) { if (e?.info?.reason === "This video is private") { return { error: "content.video.private" }; } else if (e?.message === "This video is unavailable") { diff --git a/api/src/util/test.js b/api/src/util/test.js index 76eb12c3..256a92fe 100644 --- a/api/src/util/test.js +++ b/api/src/util/test.js @@ -31,7 +31,7 @@ const runTestsFor = async (service) => { await runTest(url, params, expected); console.log(`${service}/${name}: ok`); - } catch(e) { + } catch (e) { softFails += !canFail; fails++; @@ -93,7 +93,7 @@ switch (action) { try { const { softFails } = await runTestsFor(process.argv[3]); process.exitCode = Number(!!softFails); - } catch(e) { + } catch (e) { console.error(e); process.exitCode = 1; break; diff --git a/web/src/lib/libav.ts b/web/src/lib/libav.ts index e5655645..4f540cf5 100644 --- a/web/src/lib/libav.ts +++ b/web/src/lib/libav.ts @@ -114,7 +114,7 @@ export default class LibAVWrapper { if (name === 'progress.txt') { try { return this.#emitProgress(data); - } catch(e) { + } catch (e) { console.error(e); } } else if (name !== outputName) return; @@ -230,4 +230,4 @@ export default class LibAVWrapper { this.onProgress(progress); } -} \ No newline at end of file +}