|

February 14th, 2009, 02:08 PM
|
|
Registered User
|
|
Join Date: Feb 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
VB Tools.Log error, Chapter 13
Hi,
I've just finished testing the try it out Checking Out for Chapter 13 on page 509. On page 515 this code is listed:
Code:
SqlEx As Exception
'some form of error - rollback the transaction and rethrow the exeption
If trans IsNot NothingThen
trans.Rollback()
End If
'Log the exception
Tools.Log("An error occurred while creating the order", SqlEx)
Throw New Exception("An error occurred while createing the order", SqlEx)
Return
Finally...
When I run the progam I get a build error telling me that the name Tools is not declared. If I comment out this line I get throught the chechout process and when I click finish I'm directed back to an error in VWD. The word 'Finally' is highlighted, and the error text is:
System.Exception was unhandled by user code
Message="An error occurred while createing the order"
Source="App_Web_uuw4qglq"
StackTrace:
at Checkout.Wizard1_FinishButtonClick(Object sender, WizardNavigationEventArgs e) in C:\BegASPNET2\Downloaded Chapters\Chapter13\Begin\Chapter13\Checkout.aspx.v b:line 111
at System.Web.UI.WebControls.Wizard.OnFinishButtonCli ck(WizardNavigationEventArgs e)
at System.Web.UI.WebControls.Wizard.OnBubbleEvent(Obj ect source, EventArgs e)
at System.Web.UI.WebControls.Wizard.WizardChildTable. OnBubbleEvent(Object source, EventArgs args)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.Button.OnCommand(Command EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException: System.NullReferenceException
Message="Object reference not set to an instance of an object."
Source="App_Web_uuw4qglq"
StackTrace:
at Checkout.Wizard1_FinishButtonClick(Object sender, WizardNavigationEventArgs e) in C:\BegASPNET2\Downloaded Chapters\Chapter13\Begin\Chapter13\Checkout.aspx.v b:line 51
InnerException:
I checked the code for the end of Chapter 13 and in place of the Tools.Log and Throw lines there's a comment:
'TODO log error
It seems the author couldn't be bothered to correct the errors in his code. Anybody have any ideas what's happening with the code?
Last edited by Roosker; February 14th, 2009 at 02:14 PM..
|