What steps will reproduce the problem?
1. Configure Elmah to use XmlErrorLog, provide a log directory that is not
created.
2. Go to elmah.axd to list errors in the nonexistent directory
What is the expected output? What do you see instead?
The expected output is an empty list of errors, similar or identical to the
view shown when directory exists but is empty.
Instead the following exception is thrown:
[DirectoryNotFoundException: Could not find a part of the path
'******************'.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +224
System.IO.FileSystemEnumerableIterator`1.CommonInit() +245
System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler) +556
System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption) +64
System.IO.DirectoryInfo.GetFiles(String searchPattern) +18
Elmah.XmlFileErrorLog.GetErrors(Int32 pageIndex, Int32 pageSize, IList errorEntryList) +104
Elmah.ErrorLogPage.OnLoad(EventArgs e) +336
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
What version of the product are you using? On what operating system?
Elmah 1.1 installed from NuGet
Please provide any additional information below.
Attached patch:
1) make GetErrors method check that the directory exists and if not found
return zero results.
2) create LogPath if not found when adding a new log entry
Since there didn't seem to be any convention for integration testing (hitting
filesystem) I did not create any tests for this. Sorry.
Original issue reported on code.google.com by jbei...@gmail.com on 11 Feb 2011 at 10:38
Original issue reported on code.google.com by
jbei...@gmail.com
on 11 Feb 2011 at 10:38Attachments: