umbraco / Umbraco.StorageProviders

MIT License
30 stars 22 forks source link

Add exists checks in AzureBlobFileSystem #40

Open ronaldbarendse opened 2 years ago

ronaldbarendse commented 2 years ago

While testing the latest RCs, I noticed the default PhysicalFileSystem does check whether the file exists before returning the last modified date, creation date and file size, but AzureBlobFileSystem doesn't and therefore returns Azure.RequestFailedException: Service request failed..

Adding an additional Exists() call will require doing multiple requests, so I think the best way if to catch the exception, check whether it's thrown because file blob doesn't exist and return a sensible default value instread.