MATLAB: SL Model Advisor – Custom check and Abnormal Exit Message

Simulink Check

I have designed a custom check which produces formatted output.
Occasionally I get failure in 'Run This Check' and such message displayed:
Abnormal exit: Undefined function or variable 'loc_modelHasActiveTestHarness'.
In command window I get:
Reference to non-existent field 'uplimit'.
But neither lasterr nor lastwarn are able to detect this error message.
Is there a light weight method I can catch some information and let it be displayed with 'Abnormal exit: Reference to non-existent field 'uplimit'.'? For example, a link to the Simulink block where the failure occurred.

Best Answer

The abnormal exit is due to some error in the sl_customization file. I tried using try and catch method to see if we can negotiate this issue. It seems to be working at my end. I used the following code in the script where the error occurs:
skipFontCheck = 0; % initializing the variable before try.
try
skipFontCheck = inputParams{1}.Values; % This is the line that causes the error
catch ME
if(strcmp(ME.identifier,'Abnormal exit'))
skipFontCheck = inputParams{1}.Value; % Here we can include the code to display the links of the block
end
end
This should resolve the issue