If dynamic resource not found

Sep 24, 2012 at 2:48 PM
Edited Sep 24, 2012 at 2:48 PM

Hi,

We had a problem on our site where one of the dynamic resources returned an error:

 

[WebException: The remote server returned an error: (503) Server Unavailable.]
   System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) +287
   System.Net.WebClient.DownloadData(Uri address) +106
   System.Net.WebClient.DownloadData(String address) +29
   Combres.ResourceContentReader.ReadNewContent(Resource resource) +250

[ResourceNotFoundException: Resource at location 'http://www.mysite.com/css/widgets.css' cannot be found]
   Combres.ResourceContentReader.ReadNewContent(Resource resource) +511
   Combres.ResourceContentReader.ReadFromCache(Resource resource, Boolean readNewIfEmptyCache) +105
   Combres.VersionGenerators.<>c__DisplayClass6.b__1(Resource r) +28
   System.Collections.Generic.List`1.ForEach(Action`1 action) +56
   Combres.VersionGenerators.HashCodeVersionGenerator.Generate(ResourceSet rs) +321
   Combres.ResourceSet.ComputeHash() +52
   Combres.ResourceSet.InitializeVersion(XElement xe, Settings parent) +141

this ended up killing the site with all the errors.

I would like to know if there is any way to skip a file that is not found, instead of erroring out on it.

Thanks!

Oct 11, 2012 at 4:11 PM

No one has any direction on this?

Oct 12, 2012 at 8:21 AM

Hello,

personally i would not want a file to be skipped as it might contain vital information for the site.

But, as a work-around you could modify the combres file "Combres\Engine\ResourceContentReader.cs" around line 105 from:

catch (WebException ex) { 
  throw new ResourceNotFoundException(resource.Path, ex); 
}

to

catch (WebException ex) { 
  content = string.Empty; 
}

John

 

 

Oct 15, 2012 at 5:51 PM

that works for my situation. Thanks!