i have the following code which show error from a string when there is a error
is there any way that i can make this in catch block?
main()
{
try
{
if (a==1)
{
string = "error1"
}
elseif (a==2)
{
string = "error2"
}
}
}
catch (e)
{
}
Like below:
i have the following code which show error from a string when there is a error
is there any way that i can make this in catch block?
main()
{
try
{
}
}
catch (e)
{
if (a==1)
{
string = "error1"
}
elseif (a==2)
{
string = "error2"
}
}