Commit 18ed9daa authored by Houtan Bastani's avatar Houtan Bastani
Browse files

reporting: make errors more clear

parent 8d36cc80
......@@ -30,7 +30,7 @@ function o = write(o)
[fid, msg] = fopen(o.filename, 'w');
if fid == -1
error(msg);
error(['@report.subsasgn: ' msg]);
end
fprintf(fid, '%% Report Object\n');
......@@ -67,6 +67,6 @@ fprintf(fid, '\\end{document}\n');
fprintf(fid, '%% End Report Object\n');
status = fclose(fid);
if status == -1
error('Error closing %s\n', o.filename);
error('@report.wrie: closing %s\n', o.filename);
end
end
\ No newline at end of file
......@@ -32,8 +32,8 @@ if nargin == 1
return;
elseif nargin > 1
if round(nargin/2) ~= nargin/2
error(['Options to Section constructor must be supplied in name/' ...
'value pairs.']);
error(['@section.section: options must be supplied in name/value ' ...
'pairs.']);
end
optNames = lower(fieldnames(o));
......@@ -44,7 +44,7 @@ elseif nargin > 1
if any(strmatch(field, optNames, 'exact'))
o.(field) = pair{2};
else
error('%s is not a recognized option to the Section constructor.', ...
error('@section.section: %s is not a recognized option.', ...
field);
end
end
......
......@@ -34,6 +34,6 @@ switch S.type
assert(isnumeric(index));
B(index) = V;
otherwise
error('objArray subsasign syntax error')
error('@section.subsasgn: syntax error')
end
end
\ No newline at end of file
......@@ -31,14 +31,14 @@ switch S(1).type
A = feval(S(1).subs, A);
end
otherwise
error(['Section Class: unknown field or method: ' S(1).subs]);
error(['@section.subsref: unknown field or method: ' S(1).subs]);
end
case '()'
A = A.elements.getElements(S(1).subs{:});
case '{}'
error(['Section Class: ' S(1).type ' indexing not supported.']);
error(['@section.subsref: ' S(1).type ' indexing not supported.']);
otherwise
error('Section Class: subsref.m impossible case')
error('@section.subsref: impossible case')
end
S = shiftS(S);
......
......@@ -26,7 +26,7 @@ switch nargin
'valid arguments are sections objects']);
s = varargin{1};
otherwise
error('Sections constructor: invalid number of arguments');
error('@sections.sections: invalid number of arguments');
end
end
......@@ -34,6 +34,6 @@ switch S.type
assert(isnumeric(index));
B.objArray(index) = V;
otherwise
error('objArray subsasign syntax error')
error('@sections.subsasgn: syntax error')
end
end
\ No newline at end of file
......@@ -31,14 +31,14 @@ switch S(1).type
A = feval(S(1).subs, A);
end
otherwise
error(['Sections Class: unknown field or method: ' S(1).subs]);
error(['@sections.subsref unknown field or method: ' S(1).subs]);
end
case '()'
A = getSections(A, S(1).subs{:});
case '{}'
error(['Sections Class: ' S(1).type ' indexing not supported.']);
error(['@sections.subsref ' S(1).type ' indexing not supported.']);
otherwise
error('Sections Class: subsref.m impossible case')
error('@sections.subsref subsref.m impossible case')
end
S = shiftS(S);
......
......@@ -34,9 +34,9 @@ switch S.type
case fieldnames(A)
B.(S.subs) = V;
otherwise
error(['field ' S.subs 'does not exist in the page class'])
error(['@table.subsasgn: field ' S.subs 'does not exist in the table class'])
end
otherwise
error('report subsasign syntax error')
error('@table.subsasgn: syntax error')
end
end
\ No newline at end of file
......@@ -31,12 +31,12 @@ switch S(1).type
A = feval(S(1).subs, A);
end
otherwise
error(['Table Class: unknown field or method: ' S(1).subs]);
error(['@table.subsref: unknown field or method: ' S(1).subs]);
end
case {'()', '{}'}
error(['Table Class: ' S(1).type ' indexing not supported.']);
error(['@table.subsref: ' S(1).type ' indexing not supported.']);
otherwise
error('Table Class: subsref.m impossible case')
error('@table.subsref: subsref.m impossible case')
end
S = shiftS(S);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment