in C# try -catch , can't catch the exception
Posted
by sunglim
on Stack Overflow
See other posts from Stack Overflow
or by sunglim
Published on 2010-05-21T12:07:03Z
Indexed on
2010/05/21
12:10 UTC
Read the original article
Hit count: 410
below code can't catch the exception.
does catch
can't catch the exception which occured in the function?
try
{
Arche.Members.Feedback.FeedbackBiz_Tx a = new Arche.Members.Feedback.FeedbackBiz_Tx();
a.AddFreeSubscriptionMember(itemNo, buyerID, itemName, DateTime.Today, DateTime.Today);
}
catch(Exception ex)
{
RegisterAlertScript(ex.Message);
}
...
public void AddFreeSubscriptionMember(string itemNo, string buyerID, string itemName, DateTime fsStartDate, DateTime fsEndDate)
{
FeedbackBiz_NTx bizNTx = new FeedbackBiz_NTx();
if (bizNTx.ExistFreeSubscription(buyerID, itemNo))
{
throw new Exception("Exception.");
}
© Stack Overflow or respective owner