Skip to content

Commit

Permalink
chore: rm prefixed error msg
Browse files Browse the repository at this point in the history
Signed-off-by: Dwi Siswanto <[email protected]>
  • Loading branch information
dwisiswant0 committed Mar 21, 2024
1 parent f67be5d commit a8d8f57
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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}`;
Expand All @@ -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;
Expand Down Expand Up @@ -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})`);
Expand Down Expand Up @@ -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) {
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion dist/pre.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
14 changes: 7 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand All @@ -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
Expand All @@ -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.`)
Expand Down Expand Up @@ -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}`);
Expand Down Expand Up @@ -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(':');
Expand All @@ -185,7 +185,7 @@ async function run() {
}

if (inputTag == "") {
core.setFailed('ERROR! Tag cannot be empty.');
core.setFailed('Tag cannot be empty.');
}

try {
Expand Down
2 changes: 1 addition & 1 deletion src/pre.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

0 comments on commit a8d8f57

Please sign in to comment.