Created
January 12, 2013 16:21
-
-
Save jamesrpatterson/4519047 to your computer and use it in GitHub Desktop.
Image Url property catching validation errors.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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