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