i am new to x development and used to write java program . i just get confused with try catch in x , please help me
public static void main(Args _args)
{
try
{
int p = 9;
p = p 9;
throw error(" error occured ");
}
catch{
int i = 8;
info("in catch ");
}finally
{
info("in finally ");
}
info(" out of try catch ");
}
if i run the code above in main method i can get all the message in page like below and that's what i expected

error occured
in catch
in finally
out of try catch
but when i use the try catch in DataEventHandler message in catch are not be shown
[DataEventHandler(tableStr(DataTransfer), DataEventType::Inserted)]
public static void DGDwDataTransfer_onInserted(Common sender, DataEventArgs e)
{
if(data.Direction == Direction::CE2FO)
{
SysInfoLogEnumerator infoLogEnum;
SysInfologMessageStruct infoMessageStruct;
str integrationMessage;
try
{
int p = 9;
p = p 9;
throw error(" error occured ");
}
catch
{
int i = 8;
info("in catch ");
}
finally
{
info("in finally ");
}
}
}
