1 classdef MExceptionUtils
3 [fullErrMsgStr,errMsgStr,stackTraceStr]=me2PlainString(meObj)
4 [fullErrMsgStr,errMsgStr,stackTraceStr]=me2HyperString(meObj)
5 [fullErrMsgStr,errMsgStr,stackTraceStr]=me2String(meObj,varargin)
7 varargout=me2ErrStackStrings(meObj,varargin)
9 stackTraceStr = meStack2PlainString(StackVec,varargin)
10 stackTraceStr = meStack2HyperString(StackVec,varargin)
11 stackTraceStr = meStack2String(StackVec,varargin)
14 methods (Access=
private,Static)
16 function [errStr, stackStr] = parseMeErrorMessage(meObj,varargin)
17 errStr=[
'message:[',meObj.message
'], identifier:[',meObj.identifier,
']'];
20 REF_AS_ERR_MSG_REG_EXP=[
'Error: <a.*opentoline\(''(.*)'',\d+,\d+\).*',...
21 'File:\ ([\w\ \.,$&/\\:@]*.m)\ Line: (\w*)\ Column: (\w*)\s*</a>\n*(.*)'];
24 tokens = regexp(errStr,REF_AS_ERR_MSG_REG_EXP,
'tokens',
'once');
26 fullFileName=tokens{1};
27 shortFileName=tokens{2};
30 StackEntry=
struct(
'file',fullFileName,
'name',shortFileName,...
31 'line',str2double(lineNumber));
32 StackVec=[StackEntry;StackVec];
34 [tokens] = regexp(errStr,...
35 'Error using ==> <a href.*>(.*)</a>\n(.*)',
'tokens',
'once');
36 if (length(tokens) == 2)
37 errStr = char(tokens(2));
41 StackVec,varargin{:});