fixing error handling
parent
2e49376e2f
commit
9b3fcb48b4
|
|
@ -539,6 +539,9 @@ class Caching {
|
||||||
static PushToCache(cacheFolder, sourceFolder, cacheKey) {
|
static PushToCache(cacheFolder, sourceFolder, cacheKey) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
try {
|
try {
|
||||||
|
if (!fs_1.default.existsSync(cacheFolder)) {
|
||||||
|
yield cloud_runner_system_1.CloudRunnerSystem.Run(`mkdir -p ${cacheFolder}`);
|
||||||
|
}
|
||||||
if (__1.Input.cloudRunnerTests) {
|
if (__1.Input.cloudRunnerTests) {
|
||||||
yield Caching.printFullCacheHierarchySize();
|
yield Caching.printFullCacheHierarchySize();
|
||||||
}
|
}
|
||||||
|
|
@ -595,6 +598,10 @@ class Caching {
|
||||||
else {
|
else {
|
||||||
remote_client_logger_1.RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`);
|
remote_client_logger_1.RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`);
|
||||||
if (cacheSelection !== ``) {
|
if (cacheSelection !== ``) {
|
||||||
|
if (__1.Input.cloudRunnerTests) {
|
||||||
|
yield cloud_runner_system_1.CloudRunnerSystem.Run(`tree ${cacheFolder}`);
|
||||||
|
}
|
||||||
|
remote_client_logger_1.RemoteClientLogger.logWarning(`cache item ${cacheKey}.zip doesn't exist ${destinationFolder}`);
|
||||||
throw new Error(`Failed to get cache item, but cache hit was found: ${cacheSelection}`);
|
throw new Error(`Failed to get cache item, but cache hit was found: ${cacheSelection}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -11,6 +11,10 @@ import { RemoteClientLogger } from './remote-client-logger';
|
||||||
export class Caching {
|
export class Caching {
|
||||||
public static async PushToCache(cacheFolder: string, sourceFolder: string, cacheKey: string) {
|
public static async PushToCache(cacheFolder: string, sourceFolder: string, cacheKey: string) {
|
||||||
try {
|
try {
|
||||||
|
if (!fs.existsSync(cacheFolder)) {
|
||||||
|
await CloudRunnerSystem.Run(`mkdir -p ${cacheFolder}`);
|
||||||
|
}
|
||||||
|
|
||||||
if (Input.cloudRunnerTests) {
|
if (Input.cloudRunnerTests) {
|
||||||
await Caching.printFullCacheHierarchySize();
|
await Caching.printFullCacheHierarchySize();
|
||||||
}
|
}
|
||||||
|
|
@ -74,6 +78,10 @@ export class Caching {
|
||||||
} else {
|
} else {
|
||||||
RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`);
|
RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`);
|
||||||
if (cacheSelection !== ``) {
|
if (cacheSelection !== ``) {
|
||||||
|
if (Input.cloudRunnerTests) {
|
||||||
|
await CloudRunnerSystem.Run(`tree ${cacheFolder}`);
|
||||||
|
}
|
||||||
|
RemoteClientLogger.logWarning(`cache item ${cacheKey}.zip doesn't exist ${destinationFolder}`);
|
||||||
throw new Error(`Failed to get cache item, but cache hit was found: ${cacheSelection}`);
|
throw new Error(`Failed to get cache item, but cache hit was found: ${cacheSelection}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue