Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dóra Kocsis
dynare
Commits
18ed9daa
Commit
18ed9daa
authored
Mar 08, 2013
by
Houtan Bastani
Browse files
reporting: make errors more clear
parent
8d36cc80
Changes
29
Show whitespace changes
Inline
Side-by-side
matlab/reports/@report/write.m
View file @
18ed9daa
...
...
@@ -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
matlab/reports/@section/section.m
View file @
18ed9daa
...
...
@@ -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
...
...
matlab/reports/@section/subsasgn.m
View file @
18ed9daa
...
...
@@ -34,6 +34,6 @@ switch S.type
assert
(
isnumeric
(
index
));
B
(
index
)
=
V
;
otherwise
error
(
'
objArray
subsas
i
gn syntax error'
)
error
(
'
@section.
subsasgn
:
syntax error'
)
end
end
\ No newline at end of file
matlab/reports/@section/subsref.m
View file @
18ed9daa
...
...
@@ -31,14 +31,14 @@ switch S(1).type
A
=
feval
(
S
(
1
)
.
subs
,
A
);
end
otherwise
error
([
'
S
ection
Class
: unknown field or method: '
S
(
1
)
.
subs
]);
error
([
'
@s
ection
.subsref
: unknown field or method: '
S
(
1
)
.
subs
]);
end
case
'()'
A
=
A
.
elements
.
getElements
(
S
(
1
)
.
subs
{:});
case
'{}'
error
([
'
S
ection
Class
: '
S
(
1
)
.
type
' indexing not supported.'
]);
error
([
'
@s
ection
.subsref
: '
S
(
1
)
.
type
' indexing not supported.'
]);
otherwise
error
(
'
S
ection
Class:
subsref
.m
impossible case'
)
error
(
'
@s
ection
.
subsref
:
impossible case'
)
end
S
=
shiftS
(
S
);
...
...
matlab/reports/@sections/sections.m
View file @
18ed9daa
...
...
@@ -26,7 +26,7 @@ switch nargin
'valid arguments are sections objects'
]);
s
=
varargin
{
1
};
otherwise
error
(
'
S
ections
constructor
: invalid number of arguments'
);
error
(
'
@s
ections
.sections
: invalid number of arguments'
);
end
end
matlab/reports/@sections/subsasgn.m
View file @
18ed9daa
...
...
@@ -34,6 +34,6 @@ switch S.type
assert
(
isnumeric
(
index
));
B
.
objArray
(
index
)
=
V
;
otherwise
error
(
'
objArray
subsas
i
gn syntax error'
)
error
(
'
@sections.
subsasgn
:
syntax error'
)
end
end
\ No newline at end of file
matlab/reports/@sections/subsref.m
View file @
18ed9daa
...
...
@@ -31,14 +31,14 @@ switch S(1).type
A
=
feval
(
S
(
1
)
.
subs
,
A
);
end
otherwise
error
([
'
S
ections
Class:
unknown field or method: '
S
(
1
)
.
subs
]);
error
([
'
@s
ections
.subsref
unknown field or method: '
S
(
1
)
.
subs
]);
end
case
'()'
A
=
getSections
(
A
,
S
(
1
)
.
subs
{:});
case
'{}'
error
([
'
S
ections
Class:
'
S
(
1
)
.
type
' indexing not supported.'
]);
error
([
'
@s
ections
.subsref
'
S
(
1
)
.
type
' indexing not supported.'
]);
otherwise
error
(
'
S
ections
Class:
subsref.m impossible case'
)
error
(
'
@s
ections
.subsref
subsref.m impossible case'
)
end
S
=
shiftS
(
S
);
...
...
matlab/reports/@table/subsasgn.m
View file @
18ed9daa
...
...
@@ -34,9 +34,9 @@ switch S.type
case
fieldnames
(
A
)
B
.
(
S
.
subs
)
=
V
;
otherwise
error
([
'field '
S
.
subs
'does not exist in the
pag
e class'
])
error
([
'
@table.subsasgn:
field '
S
.
subs
'does not exist in the
tabl
e class'
])
end
otherwise
error
(
'
report
subsas
i
gn syntax error'
)
error
(
'
@table.
subsasgn
:
syntax error'
)
end
end
\ No newline at end of file
matlab/reports/@table/subsref.m
View file @
18ed9daa
...
...
@@ -31,12 +31,12 @@ switch S(1).type
A
=
feval
(
S
(
1
)
.
subs
,
A
);
end
otherwise
error
([
'
T
able
Class
: unknown field or method: '
S
(
1
)
.
subs
]);
error
([
'
@t
able
.subsref
: unknown field or method: '
S
(
1
)
.
subs
]);
end
case
{
'()'
,
'{}'
}
error
([
'
T
able
Class
: '
S
(
1
)
.
type
' indexing not supported.'
]);
error
([
'
@t
able
.subsref
: '
S
(
1
)
.
type
' indexing not supported.'
]);
otherwise
error
(
'
T
able
Class
: subsref.m impossible case'
)
error
(
'
@t
able
.subsref
: subsref.m impossible case'
)
end
S
=
shiftS
(
S
);
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment