I have some good news and some bad news. The bad news is that the Library Project does not make direct reads or writes of standard files, and has no need for file streams. That means we won't be adding any code to the project in this chapter at all. The good news is that we still have interesting things to talk about. Besides, I figured that since you had finished more than half of the book, you could use a break.
Chapter 15 does not include any project templates, so don't bother looking in Visual Studio for them.
Whenever an error occurs in the Library application, the
GeneralError routine first shows the error message to the user, and then logs it to any configured "log listeners."
Public Sub GeneralError(ByVal routineName As String, _ ByVal theError As System.Exception) ' ----- Report an error to the user. On Error Resume Next MsgBox("The following error occurred at location '" & _ routineName & "':" & vbCrLf & vbCrLf & _ theError.Message, MsgBoxStyle.OkOnly Or _ MsgBoxStyle.Exclamation, ProgramTitle)
So, who's listening? If you are running the program within Visual Studio, Visual Basic always configures a log listener that displays the text in the Immediate Window panel. But that doesn't do much good in a compiled and deployed application.
You can design your own log listeners, but .NET also includes several predefined listeners, all of which can be enabled and configured through the ...