showErrorDialogStd¶
- utils.dlgs.showErrorDialogStd(guiHandle, err, winTitle, optionalPrefix, optionalSuffix)¶
SHOWERRORDIALOGSTD - show error that is generated in try/catch blocks or in any other occasion.
- Syntax:
function showErrorDialogStd(guiHandle, err, winTitle, optionalPrefix, optionalSuffix)- Input Arguments:
guiHandle - handle to appdesigner window (for example, obj.View.gui)
err - a structure generated by MATLAB, when an error is triggered with the following fields, .identifier - identification of the error .message - error message .cause - MException
winTitle - an optional string with a title for the window
optionalPrefix - an optional text string that will be added before the end of the error message
optionalSuffix - an optional text string that will be added after the end of the error message
- Usage:
Example 1:
try // some code catch err utils.dlgs.showErrorDialogStd(obj.view.gui, err, 'Missing net-variable'); // when called from MibController return; endExample 2:
errorText = sprintf('!!! Error !!!\n\nSomething went wrong!'); suffix = 'some text at the bottom'; utils.dlgs.showErrorDialogStd([], errorText, 'Error', [], suffix); return;Example 3:
ErrorDlgOpt.winTitle = 'Error in MibModel.datasetsSetsOps'; ErrorDlgOpt.optionalPrefix = sprintf('!!! Warning !!!\n\nThe last set can not be removed!'); eventdata = core.ToggleEventData(ErrorDlgOpt); notify(obj, 'ShowErrorDialog', eventdata);