My code is like this
private void GetShippingInstruction()
{
try
{
string json = JsonConvert.SerializeObject(ds, Formatting.Indented);
ShowResult(json);
}
catch (Exception ex)
{
//custom logic
}
}
private void ShowResult(string json )
{
try
{
Response.Write(json);
Response.End();
}
catch
{
return;
// do nothing for now
}
}
If any error occurs inside ShowResult function I want ignore that Error and go on. I have tried some thing like adding return
in the catch block. But its not helping me, after executing the catch block of ShorResult()
it directly goes to the Catch block of GetShippingInstruction
, which I do not want. Is there any way to solve this issue?
Sample Code: https://dotnetfiddle.net/Jbse21
And the error I get: {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}