Handle S3Errors::RESOURCE_NOT_FOUND from aws-sdk-cpp
This is returned by recent versions. Also handle NO_SUCH_KEY even though the library doesn't actually return that at the moment.
This commit is contained in:
		
							parent
							
								
									1c969611ba
								
							
						
					
					
						commit
						b33621d425
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		|  | @ -233,8 +233,10 @@ struct S3BinaryCacheStoreImpl : public S3BinaryCacheStore | ||||||
| 
 | 
 | ||||||
|         if (!res.IsSuccess()) { |         if (!res.IsSuccess()) { | ||||||
|             auto & error = res.GetError(); |             auto & error = res.GetError(); | ||||||
|             if (error.GetErrorType() == Aws::S3::S3Errors::UNKNOWN // FIXME
 |             if (error.GetErrorType() == Aws::S3::S3Errors::RESOURCE_NOT_FOUND | ||||||
|                 && error.GetMessage().find("404") != std::string::npos) |                 || error.GetErrorType() == Aws::S3::S3Errors::NO_SUCH_KEY | ||||||
|  |                 || (error.GetErrorType() == Aws::S3::S3Errors::UNKNOWN // FIXME
 | ||||||
|  |                     && error.GetMessage().find("404") != std::string::npos)) | ||||||
|                 return false; |                 return false; | ||||||
|             throw Error(format("AWS error fetching ‘%s’: %s") % path % error.GetMessage()); |             throw Error(format("AWS error fetching ‘%s’: %s") % path % error.GetMessage()); | ||||||
|         } |         } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue