How to handle errors when using the A3DAsmModelFileLoadFromFile function in C++

When importing a CAD Data File using the A3DAsmModelFileLoadFromFile function, when reading an incorrect or damaged Data File, a problem occurs in the Progam we are developing and the entire program crashes. I am curious about how to prevent this.

I’ve currently tried using C++ Try Catch to handle this issue, but it doesn’t seem to solve the problem.

We are processing it as follows:

A3DAsmModelFile * pcAsmModelFile = nullptr;
A3DStatus eStatus = A3D_ERROR;
eStatus = A3DAsmModelFileLoadFromFile(pchUtf8Path, &cParamsLoadData, &pcAsmModelFile);
delete [] pchUtf8Path;

The callback function was also set up.

A3DStatus nStatus = A3DDllSetCallbacksReport(CallbackReportMessage, CallbackReportWarning, CallbackReportError);
if(A3D_SUCCESS == nStatus) {
return true;
}

Currently, I am having trouble because the program terminates when the wrong CAD file is read. I would appreciate it if you could tell me how to solve this problem.

Or, it would be better if there was a way to check for incorrect CAD files in advance.

I would appreciate it if you could give me some good ideas.