Skip to content

Instantly share code, notes, and snippets.

@jamesrpatterson
Created January 12, 2013 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesrpatterson/4519047 to your computer and use it in GitHub Desktop.
Save jamesrpatterson/4519047 to your computer and use it in GitHub Desktop.
Image Url property catching validation errors.
namespace MyWebsite.PropertyTypes
{
using System;
using System.IO;
using EPiServer.SpecializedProperties;
using log4net;
public class PropertyDCImageUrl : PropertyImageUrl
{
private static ILog logger = LogManager.GetLogger(typeof(PropertyDCImageUrl));
protected override void ValidateUri(Uri uri)
{
try
{
base.ValidateUri(uri);
}
catch (FileNotFoundException ex)
{
// Log this error.
logger.Warn(ex.Message, ex);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment