From a8d8f573cfb0f2d7ca0e5c4b97dde88bf8d4ebc8 Mon Sep 17 00:00:00 2001 From: Dwi Siswanto Date: Fri, 22 Mar 2024 00:25:26 +0700 Subject: [PATCH] chore: rm prefixed error msg Signed-off-by: Dwi Siswanto --- dist/index.js | 14 +++++++------- dist/pre.js | 2 +- src/index.ts | 14 +++++++------- src/pre.ts | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/dist/index.js b/dist/index.js index 3e9aa87..cc0bfa9 100644 --- a/dist/index.js +++ b/dist/index.js @@ -52,7 +52,7 @@ function get_slim() { } } catch (_a) { - throw new Error(`ERROR! Could not get the Slim version ${VER}.`); + throw new Error(`Could not get the Slim version ${VER}.`); } URL = `https://downloads.dockerslim.com/releases/${VER}`; // Get kernel name and machine architecture. @@ -81,11 +81,11 @@ function get_slim() { } } else { - throw new Error(`ERROR! ${KERNEL} is not a supported platform.`); + throw new Error(`${KERNEL} is not a supported platform.`); } // Was a known distribution detected? if (!DIST) { - throw new Error(`ERROR! ${MACHINE} is not a supported architecture.`); + throw new Error(`${MACHINE} is not a supported architecture.`); } // Derive the filename FILENAME = `dist_${DIST}.${EXT}`; @@ -97,7 +97,7 @@ function get_slim() { const_1.core.debug('Restoring cache'); const cacheResult = yield const_1.cache.restoreCache([cachePath], cacheKey, [`${cachePrefix}-`]); if (typeof cacheResult === 'undefined') { - throw new Error(`ERROR! Cache miss: ${cacheKey} was not found in the cache.`); + throw new Error(`Cache miss: ${cacheKey} was not found in the cache.`); } const_1.core.debug(`${cacheKey} cache was restored.`); SLIM_PATH = cachePath; @@ -132,7 +132,7 @@ function get_slim() { }); } else { - throw new Error('ERROR! Unexpected file extension.'); + throw new Error('Unexpected file extension.'); } SLIM_PATH = const_1.path.join(const_1.TMP_DIR, `dist_${DIST}`); const_1.core.debug(`Copying ${SLIM_PATH} -> (${cachePath})`); @@ -161,7 +161,7 @@ function run() { const report = JSON.parse(data); const_1.core.setOutput('report', report); if (report.state == 'error') { - throw new Error('ERROR! Cannot build over target'); + throw new Error('Cannot build over target'); } const [image, tag] = report.target_reference.split(':'); if (inputOverwrite && tag) { @@ -174,7 +174,7 @@ function run() { }); } if (inputTag == "") { - const_1.core.setFailed('ERROR! Tag cannot be empty.'); + const_1.core.setFailed('Tag cannot be empty.'); } try { run(); diff --git a/dist/pre.js b/dist/pre.js index 81e113d..07d53fe 100644 --- a/dist/pre.js +++ b/dist/pre.js @@ -6,5 +6,5 @@ try { const_1.core.info('docker command OK!'); } catch (_a) { - const_1.core.setFailed('ERROR! docker: command not found'); + const_1.core.setFailed('docker: command not found'); } diff --git a/src/index.ts b/src/index.ts index 659e5ca..48c7ffc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -46,7 +46,7 @@ async function get_slim() { VER = inputVersion; } } catch { - throw new Error(`ERROR! Could not get the Slim version ${VER}.`); + throw new Error(`Could not get the Slim version ${VER}.`); } URL = `https://downloads.dockerslim.com/releases/${VER}`; @@ -73,12 +73,12 @@ async function get_slim() { DIST = 'mac_m1'; } } else { - throw new Error(`ERROR! ${KERNEL} is not a supported platform.`); + throw new Error(`${KERNEL} is not a supported platform.`); } // Was a known distribution detected? if (!DIST) { - throw new Error(`ERROR! ${MACHINE} is not a supported architecture.`); + throw new Error(`${MACHINE} is not a supported architecture.`); } // Derive the filename @@ -96,7 +96,7 @@ async function get_slim() { ); if (typeof cacheResult === 'undefined') { - throw new Error(`ERROR! Cache miss: ${cacheKey} was not found in the cache.`) + throw new Error(`Cache miss: ${cacheKey} was not found in the cache.`) } core.debug(`${cacheKey} cache was restored.`) @@ -132,7 +132,7 @@ async function get_slim() { cwd: TMP_DIR }); } else { - throw new Error('ERROR! Unexpected file extension.'); + throw new Error('Unexpected file extension.'); } SLIM_PATH = path.join(TMP_DIR, `dist_${DIST}`); @@ -168,7 +168,7 @@ async function run() { core.setOutput('report', report); if (report.state == 'error') { - throw new Error('ERROR! Cannot build over target'); + throw new Error('Cannot build over target'); } const [image, tag] = report.target_reference.split(':'); @@ -185,7 +185,7 @@ async function run() { } if (inputTag == "") { - core.setFailed('ERROR! Tag cannot be empty.'); + core.setFailed('Tag cannot be empty.'); } try { diff --git a/src/pre.ts b/src/pre.ts index 3d01ed8..8861c88 100644 --- a/src/pre.ts +++ b/src/pre.ts @@ -4,5 +4,5 @@ try { io.which('docker', true); core.info('docker command OK!'); } catch { - core.setFailed('ERROR! docker: command not found'); + core.setFailed('docker: command not found'); }