Mercurial > octave
annotate libinterp/corefcn/gripes.cc @ 20756:200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
* gripes.h, gripes.cc (gripe_user_supplied_eval,
gripe_wrong_type_arg): New overloaded functions that accept
octave_execution_exception objects.
* error.h, error.cc (error, verror, error_1, usage_1,
debug_or_throw_exception): New overloaded functions that accept
* octave_execution_exception objects.
* __qp__.cc, cellfun.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc,
file-io.cc, graphics.cc, graphics.in.h, input.cc, load-path.cc,
ls-mat-ascii.cc, lsode.cc, mex.cc, oct-handle.h, oct-map.cc,
oct-stream.cc, quad.cc, rand.cc, toplev.cc, utils.cc, variables.cc,
__eigs__.cc, ov-base.cc, ov-class.cc, ov-fcn-handle.cc,
ov-oncleanup.cc, ov.cc, octave.cc, oct-parse.in.yy: Propagate
octave_execution_exception objects through try/catch blocks.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 25 Nov 2015 15:27:48 -0500 |
parents | 68e3a747ca02 |
children | b6f2909e7f94 |
rev | line source |
---|---|
1 | 1 /* |
2 | |
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19030
diff
changeset
|
3 Copyright (C) 1993-2015 John W. Eaton |
1 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
1 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
1 | 20 |
21 */ | |
22 | |
240 | 23 #ifdef HAVE_CONFIG_H |
1192 | 24 #include <config.h> |
1 | 25 #endif |
26 | |
5755 | 27 #include "defun.h" |
1352 | 28 #include "error.h" |
1 | 29 #include "gripes.h" |
4055 | 30 #include "oct-obj.h" |
5755 | 31 #include "utils.h" |
32 | |
1 | 33 void |
2078 | 34 gripe_not_supported (const char *fcn) |
35 { | |
36 error ("%s: not supported on this system", fcn); | |
37 } | |
38 | |
39 void | |
6890 | 40 gripe_not_implemented (const char *fcn) |
41 { | |
42 error ("%s: not implemented", fcn); | |
43 } | |
44 | |
45 void | |
1 | 46 gripe_string_invalid (void) |
47 { | |
3523 | 48 error ("std::string constant used in invalid context"); |
1 | 49 } |
50 | |
51 void | |
52 gripe_range_invalid (void) | |
53 { | |
54 error ("range constant used in invalid context"); | |
55 } | |
56 | |
57 void | |
58 gripe_nonconformant (void) | |
59 { | |
60 error ("nonconformant matrices"); | |
61 } | |
62 | |
63 void | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
64 gripe_nonconformant (octave_idx_type r1, octave_idx_type c1, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
65 octave_idx_type r2, octave_idx_type c2) |
143 | 66 { |
67 error ("nonconformant matrices (op1 is %dx%d, op2 is %dx%d)", | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
68 r1, c1, r2, c2); |
143 | 69 } |
70 | |
71 void | |
2799 | 72 gripe_empty_arg (const char *name, bool is_error) |
1 | 73 { |
74 if (is_error) | |
75 error ("%s: empty matrix is invalid as an argument", name); | |
76 else | |
77 warning ("%s: argument is empty matrix", name); | |
78 } | |
79 | |
80 void | |
81 gripe_square_matrix_required (const char *name) | |
82 { | |
83 error ("%s: argument must be a square matrix", name); | |
84 } | |
85 | |
86 void | |
87 gripe_user_supplied_eval (const char *name) | |
88 { | |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
89 octave_execution_exception e; |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
90 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
91 gripe_user_supplied_eval (e, name); |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
92 } |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
93 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
94 void |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
95 gripe_user_supplied_eval (const octave_execution_exception& e, |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
96 const char *name) |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
97 { |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
98 error (e, "%s: evaluation of user-supplied function failed", name); |
1 | 99 } |
100 | |
101 void | |
102 gripe_user_returned_invalid (const char *name) | |
103 { | |
104 error ("%s: user-supplied function returned invalid value", name); | |
105 } | |
106 | |
628 | 107 void |
3523 | 108 gripe_invalid_conversion (const std::string& from, const std::string& to) |
628 | 109 { |
2374 | 110 error ("invalid conversion from %s to %s", from.c_str (), to.c_str ()); |
628 | 111 } |
112 | |
777 | 113 void |
1416 | 114 gripe_invalid_value_specified (const char *name) |
115 { | |
15466
d174210ce1ec
use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
116 warning ("invalid value specified for '%s'", name); |
1416 | 117 } |
118 | |
119 void | |
777 | 120 gripe_2_or_3_dim_plot (void) |
121 { | |
122 error ("plot: can only plot in 2 or 3 dimensions"); | |
123 } | |
124 | |
125 void | |
126 gripe_unrecognized_float_fmt (void) | |
127 { | |
128 error ("unrecognized floating point format requested"); | |
129 } | |
130 | |
131 void | |
132 gripe_unrecognized_data_fmt (const char *warn_for) | |
133 { | |
134 error ("%s: unrecognized data format requested", warn_for); | |
135 } | |
136 | |
137 void | |
138 gripe_data_conversion (const char *from, const char *to) | |
139 { | |
140 error ("unable to convert from %s to %s format", from, to); | |
141 } | |
142 | |
143 void | |
5602 | 144 gripe_wrong_type_arg (const char *name, const char *s, bool is_error) |
2668 | 145 { |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
146 octave_execution_exception e; |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
147 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
148 gripe_wrong_type_arg (e, name, s, is_error); |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
149 } |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
150 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
151 void |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
152 gripe_wrong_type_arg (const octave_execution_exception& e, |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
153 const char *name, const char *s, bool is_error) |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
154 { |
2799 | 155 if (is_error) |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
156 error (e, "%s: wrong type argument '%s'", name, s); |
2799 | 157 else |
15466
d174210ce1ec
use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
158 warning ("%s: wrong type argument '%s'", name, s); |
5602 | 159 } |
160 | |
161 void | |
162 gripe_wrong_type_arg (const char *name, const std::string& s, bool is_error) | |
163 { | |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
164 octave_execution_exception e; |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
165 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
166 gripe_wrong_type_arg (e, name, s.c_str (), is_error); |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
167 } |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
168 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
169 void |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
170 gripe_wrong_type_arg (const octave_execution_exception& e, |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
171 const char *name, const std::string& s, bool is_error) |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
172 { |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
173 gripe_wrong_type_arg (e, name, s.c_str (), is_error); |
2668 | 174 } |
175 | |
176 void | |
2799 | 177 gripe_wrong_type_arg (const char *name, const octave_value& tc, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
178 bool is_error) |
777 | 179 { |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
180 octave_execution_exception e; |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
181 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
182 gripe_wrong_type_arg (e, name, tc, is_error); |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
183 } |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
184 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
185 void |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
186 gripe_wrong_type_arg (const octave_execution_exception& e, |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
187 const char *name, const octave_value& tc, |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
188 bool is_error) |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
189 { |
3523 | 190 std::string type = tc.type_name (); |
2799 | 191 |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
192 gripe_wrong_type_arg (e, name, type, is_error); |
777 | 193 } |
194 | |
195 void | |
7352 | 196 gripe_wrong_type_arg (const std::string& name, const octave_value& tc, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
197 bool is_error) |
7352 | 198 { |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
199 octave_execution_exception e; |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
200 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
201 gripe_wrong_type_arg (e, name, tc, is_error); |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
202 } |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
203 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
204 void |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
205 gripe_wrong_type_arg (const octave_execution_exception& e, |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
206 const std::string& name, const octave_value& tc, |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
207 bool is_error) |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
208 { |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
209 gripe_wrong_type_arg (e, name.c_str (), tc, is_error); |
7352 | 210 } |
211 | |
212 void | |
20700
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
213 gripe_wrong_type_arg (const char *s, bool is_error) |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
214 { |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
215 octave_execution_exception e; |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
216 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
217 gripe_wrong_type_arg (e, s, is_error); |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
218 } |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
219 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
220 void |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
221 gripe_wrong_type_arg (const octave_execution_exception& e, |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
222 const char *s, bool is_error) |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
223 { |
20700
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
224 if (is_error) |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
225 error (e, "wrong type argument '%s'", s); |
20700
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
226 else |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
227 warning ("wrong type argument '%s'", s); |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
228 } |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
229 |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
230 void |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
231 gripe_wrong_type_arg (const std::string& s, bool is_error) |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
232 { |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
233 octave_execution_exception e; |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
234 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
235 gripe_wrong_type_arg (e, s, is_error); |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
236 } |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
237 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
238 void |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
239 gripe_wrong_type_arg (const octave_execution_exception& e, |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
240 const std::string& s, bool is_error) |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
241 { |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
242 gripe_wrong_type_arg (e, s.c_str (), is_error); |
20700
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
243 } |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
244 |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
245 void |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
246 gripe_wrong_type_arg (const octave_value& tc, bool is_error) |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
247 { |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
248 octave_execution_exception e; |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
249 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
250 gripe_wrong_type_arg (e, tc, is_error); |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
251 } |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
252 |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
253 void |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
254 gripe_wrong_type_arg (const octave_execution_exception& e, |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
255 const octave_value& tc, bool is_error) |
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
256 { |
20700
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
257 std::string type = tc.type_name (); |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
258 |
20756
200ae1d650b7
propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents:
20700
diff
changeset
|
259 gripe_wrong_type_arg (e, type, is_error); |
20700
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
260 } |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
261 |
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20535
diff
changeset
|
262 void |
2086 | 263 gripe_wrong_type_arg_for_unary_op (const octave_value& op) |
777 | 264 { |
3523 | 265 std::string type = op.type_name (); |
15466
d174210ce1ec
use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
266 error ("invalid operand '%s' for unary operator", type.c_str ()); |
777 | 267 } |
268 | |
269 void | |
2086 | 270 gripe_wrong_type_arg_for_binary_op (const octave_value& op) |
777 | 271 { |
3523 | 272 std::string type = op.type_name (); |
15466
d174210ce1ec
use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
273 error ("invalid operand '%s' for binary operator", type.c_str ()); |
2374 | 274 } |
275 | |
276 void | |
5781 | 277 gripe_implicit_conversion (const char *id, const char *from, const char *to) |
2374 | 278 { |
5781 | 279 warning_with_id (id, "implicit conversion from %s to %s", from, to); |
2374 | 280 } |
281 | |
282 void | |
5781 | 283 gripe_implicit_conversion (const std::string& id, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
284 const std::string& from, const std::string& to) |
4452 | 285 { |
5781 | 286 warning_with_id (id.c_str (), |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
287 "implicit conversion from %s to %s", |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
288 from.c_str (), to.c_str ()); |
4452 | 289 } |
290 | |
291 void | |
2374 | 292 gripe_divide_by_zero (void) |
293 { | |
5781 | 294 warning_with_id ("Octave:divide-by-zero", "division by zero"); |
5755 | 295 } |
296 | |
8012
63dbb85452cc
fix extern decls in .cc files
John W. Eaton <jwe@octave.org>
parents:
8011
diff
changeset
|
297 void |
5943 | 298 gripe_logical_conversion (void) |
299 { | |
300 warning_with_id ("Octave:logical-conversion", | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
301 "value not equal to 1 or 0 converted to logical 1"); |
5943 | 302 } |
303 | |
8012
63dbb85452cc
fix extern decls in .cc files
John W. Eaton <jwe@octave.org>
parents:
8011
diff
changeset
|
304 void |
8579
7e0f36dfefbe
implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
305 gripe_invalid_inquiry_subscript (void) |
7e0f36dfefbe
implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
306 { |
7e0f36dfefbe
implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
307 error ("invalid dimension inquiry of a non-existent value"); |
7e0f36dfefbe
implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
308 } |
7e0f36dfefbe
implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
309 |
7e0f36dfefbe
implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
310 void |
7e0f36dfefbe
implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
311 gripe_indexed_cs_list (void) |
7e0f36dfefbe
implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
312 { |
7e0f36dfefbe
implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
313 error ("a cs-list cannot be further indexed"); |
7e0f36dfefbe
implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
314 } |
7e0f36dfefbe
implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents:
8039
diff
changeset
|
315 |
9588
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
316 void |
10030
83bb2a78c07d
improve simple assignments error checks and messages
Jaroslav Hajek <highegg@gmail.com>
parents:
9588
diff
changeset
|
317 gripe_nonbraced_cs_list_assignment (void) |
83bb2a78c07d
improve simple assignments error checks and messages
Jaroslav Hajek <highegg@gmail.com>
parents:
9588
diff
changeset
|
318 { |
11590
4ced6b90fffb
style fixes for warning and error messages in source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
319 error ("invalid assignment to cs-list outside multiple assignment"); |
10030
83bb2a78c07d
improve simple assignments error checks and messages
Jaroslav Hajek <highegg@gmail.com>
parents:
9588
diff
changeset
|
320 } |
83bb2a78c07d
improve simple assignments error checks and messages
Jaroslav Hajek <highegg@gmail.com>
parents:
9588
diff
changeset
|
321 |
83bb2a78c07d
improve simple assignments error checks and messages
Jaroslav Hajek <highegg@gmail.com>
parents:
9588
diff
changeset
|
322 void |
9588
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
323 gripe_warn_complex_cmp (void) |
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
324 { |
19852
e9a0bd0b125c
Rename 'matlab-incompatible' warning to 'language-extension'.
Carnë Draug <carandraug@octave.org>
parents:
19697
diff
changeset
|
325 warning_with_id ("Octave:language-extension", |
e9a0bd0b125c
Rename 'matlab-incompatible' warning to 'language-extension'.
Carnë Draug <carandraug@octave.org>
parents:
19697
diff
changeset
|
326 "comparing complex numbers is not supported in Matlab"); |
9588
319e2ab9b8ae
warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
327 } |
16899
55caca526827
New function to error due to disabled feature during build.
Carnë Draug <carandraug@octave.org>
parents:
16892
diff
changeset
|
328 |
55caca526827
New function to error due to disabled feature during build.
Carnë Draug <carandraug@octave.org>
parents:
16892
diff
changeset
|
329 void |
55caca526827
New function to error due to disabled feature during build.
Carnë Draug <carandraug@octave.org>
parents:
16892
diff
changeset
|
330 gripe_disabled_feature (const std::string& func, const std::string& feature, |
55caca526827
New function to error due to disabled feature during build.
Carnë Draug <carandraug@octave.org>
parents:
16892
diff
changeset
|
331 const std::string& pkg /*="Octave"*/) |
55caca526827
New function to error due to disabled feature during build.
Carnë Draug <carandraug@octave.org>
parents:
16892
diff
changeset
|
332 { |
55caca526827
New function to error due to disabled feature during build.
Carnë Draug <carandraug@octave.org>
parents:
16892
diff
changeset
|
333 error ("%s: support for %s was disabled when %s was built", |
55caca526827
New function to error due to disabled feature during build.
Carnë Draug <carandraug@octave.org>
parents:
16892
diff
changeset
|
334 func.c_str (), feature.c_str (), pkg.c_str ()); |
55caca526827
New function to error due to disabled feature during build.
Carnë Draug <carandraug@octave.org>
parents:
16892
diff
changeset
|
335 } |
19030
9ef10e6a5987
make "file found in path" warnings consistent
John W. Eaton <jwe@octave.org>
parents:
17787
diff
changeset
|
336 |
9ef10e6a5987
make "file found in path" warnings consistent
John W. Eaton <jwe@octave.org>
parents:
17787
diff
changeset
|
337 void |
9ef10e6a5987
make "file found in path" warnings consistent
John W. Eaton <jwe@octave.org>
parents:
17787
diff
changeset
|
338 gripe_data_file_in_path (const std::string& fcn, const std::string& file) |
9ef10e6a5987
make "file found in path" warnings consistent
John W. Eaton <jwe@octave.org>
parents:
17787
diff
changeset
|
339 { |
9ef10e6a5987
make "file found in path" warnings consistent
John W. Eaton <jwe@octave.org>
parents:
17787
diff
changeset
|
340 warning_with_id ("Octave:data-file-in-path", |
9ef10e6a5987
make "file found in path" warnings consistent
John W. Eaton <jwe@octave.org>
parents:
17787
diff
changeset
|
341 "%s: '%s' found by searching load path", |
9ef10e6a5987
make "file found in path" warnings consistent
John W. Eaton <jwe@octave.org>
parents:
17787
diff
changeset
|
342 fcn.c_str (), file.c_str ()); |
9ef10e6a5987
make "file found in path" warnings consistent
John W. Eaton <jwe@octave.org>
parents:
17787
diff
changeset
|
343 } |