26 #if ! defined (octave_error_h)
27 #define octave_error_h 1
29 #include "octave-config.h"
64 bool val = m_debug_on_error;
65 m_debug_on_error = flag;
78 bool val = m_debug_on_caught;
79 m_debug_on_caught = flag;
92 bool val = m_debug_on_warning;
93 m_debug_on_warning = flag;
102 m_discard_warning_messages = flag;
107 return m_discard_warning_messages;
112 bool val = m_discard_warning_messages;
113 m_discard_warning_messages = flag;
126 bool val = m_beep_on_error;
127 m_beep_on_error = flag;
140 bool val = m_backtrace_on_warning;
141 m_backtrace_on_warning = flag;
154 bool val = m_verbose_warning;
155 m_verbose_warning = flag;
168 bool val = m_quiet_warning;
169 m_quiet_warning = flag;
176 { m_warning_options = val; }
181 m_warning_options = new_val;
189 { m_last_error_message = val; }
195 std::string val = m_last_error_message;
196 m_last_error_message = s;
204 { m_last_warning_message = val; }
207 {
return m_last_warning_message; }
211 std::string val = m_last_warning_message;
212 m_last_warning_message = s;
220 { m_last_warning_id = val; }
226 std::string val = m_last_warning_id;
227 m_last_warning_id = s;
240 std::string val = m_last_error_id;
247 m_last_error_stack = val;
255 m_last_error_stack = new_val;
262 static OCTINTERP_API std::list<frame_info>
272 verror (
bool save_last_error, std::ostream& os,
const char *name,
273 const char *
id,
const char *fmt, va_list args,
274 bool with_cfn =
false);
277 vwarning (
const char *name,
const char *
id,
const char *fmt,
286 OCTINTERP_API
void error_1 (
const char *
id,
const char *fmt, va_list args);
289 OCTINTERP_API
void vusage (
const char *
id,
const char *fmt, va_list args);
291 OCTINTERP_API
void vwarning (
const char *
id,
const char *fmt, va_list args);
295 rethrow_error (
const std::string&
id,
const std::string& msg,
299 OCTINTERP_API
void vpanic (
const char *fmt, va_list args);
302 OCTINTERP_API
void panic (
const char *fmt, ...);
325 const std::string&
id,
327 const std::list<frame_info>& stack_info
328 = std::list<frame_info> ());
345 bool m_debug_on_error;
350 bool m_debug_on_caught;
355 bool m_debug_on_warning;
359 bool m_discard_warning_messages;
363 bool m_beep_on_error;
367 bool m_backtrace_on_warning;
371 bool m_verbose_warning;
375 bool m_quiet_warning;
381 std::string m_last_error_message;
384 std::string m_last_warning_message;
387 std::string m_last_warning_id;
390 std::string m_last_error_id;
396 OCTAVE_END_NAMESPACE(
octave)
404 extern OCTINTERP_API
void
405 vmessage (
const char *name,
const char *fmt, va_list args);
407 OCTAVE_FORMAT_PRINTF (2, 3)
408 extern OCTINTERP_API
void message (const
char *name, const
char *fmt, ...);
410 extern OCTINTERP_API
void vwarning (const
char *fmt, va_list args);
412 OCTAVE_FORMAT_PRINTF (1, 2)
413 extern OCTINTERP_API
void warning (const
char *fmt, ...);
416 extern OCTINTERP_API
void verror (const
char *fmt, va_list args);
418 OCTAVE_FORMAT_PRINTF (1, 2)
420 extern OCTINTERP_API
void error (const
char *fmt, ...);
423 extern OCTINTERP_API
void
426 OCTAVE_FORMAT_PRINTF (2, 3)
428 extern OCTINTERP_API
void
432 extern OCTINTERP_API
void
435 OCTAVE_FORMAT_PRINTF (1, 2)
437 extern OCTINTERP_API
void
441 extern OCTINTERP_API
void
444 OCTAVE_FORMAT_PRINTF (1, 2)
446 extern OCTINTERP_API
void
450 extern OCTINTERP_API
void
453 OCTAVE_FORMAT_PRINTF (2, 3)
455 extern OCTINTERP_API
void
458 extern OCTINTERP_API
void
461 OCTAVE_FORMAT_PRINTF (2, 3)
462 extern OCTINTERP_API
void
466 extern OCTINTERP_API
void
469 OCTAVE_FORMAT_PRINTF (2, 3)
471 extern OCTINTERP_API
void
475 extern OCTINTERP_API
void
478 OCTAVE_FORMAT_PRINTF (2, 3)
480 extern OCTINTERP_API
void
484 extern OCTINTERP_API
void
487 OCTAVE_FORMAT_PRINTF (2, 3)
489 extern OCTINTERP_API
void
493 extern OCTINTERP_API
void vpanic (const
char *fmt, va_list args);
495 OCTAVE_FORMAT_PRINTF (1, 2)
497 extern OCTINTERP_API
void panic (const
char *fmt, ...);
503 #define panic_impossible() \
504 ::panic ("impossible state reached in file '%s' at line %d", __FILE__, __LINE__)
507 # define panic_if(cond)
509 # define panic_if(cond) do { if (cond) panic_impossible (); } while (0)
513 # define panic_unless(cond)
515 # define panic_unless(cond) panic_if (! (cond))
518 #define error_impossible() \
519 ::error ("impossible state reached in file '%s' at line %d", __FILE__, __LINE__)
522 # define error_if(cond)
524 # define error_if(cond) do { if (cond) error_impossible (); } while (0)
528 # define error_unless(cond)
530 # define error_unless(cond) error_if (! (cond))
553 OCTAVE_END_NAMESPACE(
octave)
error_system(interpreter &interp)
bool debug_on_error(bool flag)
std::string last_error_message() const
void set_beep_on_error(bool flag)
void interpreter_try(unwind_protect &frame)
void display_warning_options(std::ostream &os)
void set_last_warning_id(const std::string &val)
void set_discard_warning_messages(bool flag)
static std::list< frame_info > make_stack_frame_list(const octave_map &stack)
void set_quiet_warning(bool flag)
void set_last_warning_message(const std::string &val)
std::string last_warning_id() const
bool debug_on_error() const
OCTAVE_NORETURN void error_1(execution_exception &ee, const char *id, const char *fmt, va_list args)
OCTAVE_NORETURN void vpanic(const char *fmt, va_list args)
std::string last_warning_id(const std::string &s)
bool debug_on_warning() const
void verror(bool save_last_error, std::ostream &os, const char *name, const char *id, const char *fmt, va_list args, bool with_cfn=false)
void set_warning_option(const std::string &state, const std::string &id)
std::string last_warning_message(const std::string &s)
bool beep_on_error() const
OCTAVE_NORETURN void rethrow_error(const std::string &id, const std::string &msg, const octave_map &stack)
bool verbose_warning() const
octave_scalar_map warning_query(const std::string &id_arg)
std::string last_error_id(const std::string &s)
OCTAVE_NORETURN void throw_error(const std::string &err_type, const std::string &id, const std::string &message, const std::list< frame_info > &stack_info=std::list< frame_info >())
octave_map last_error_stack() const
int warning_enabled(const std::string &id)
For given warning ID, return 0 if warnings are disabled, 1 if enabled, and 2 if the given ID should b...
std::string last_warning_message() const
octave_map warning_options(const octave_map &new_val)
bool verbose_warning(bool flag)
octave_map last_error_stack(const octave_map &new_val)
static octave_map make_stack_map(const std::list< frame_info > &frames)
OCTAVE_NORETURN void vusage(const char *id, const char *fmt, va_list args)
bool backtrace_on_warning(bool flag)
bool debug_on_caught(bool flag)
bool discard_warning_messages() const
octave_map warning_options() const
void set_last_error_stack(const octave_map &val)
void disable_warning(const std::string &id)
void initialize_default_warning_state()
void vwarning(const char *name, const char *id, const char *fmt, va_list args)
void set_debug_on_warning(bool flag)
bool debug_on_caught() const
void set_verbose_warning(bool flag)
std::string last_error_id() const
void save_exception(const execution_exception &ee)
void set_last_error_id(const std::string &val)
bool discard_warning_messages(bool flag)
void set_backtrace_on_warning(bool flag)
bool quiet_warning() const
bool quiet_warning(bool flag)
bool beep_on_error(bool flag)
bool backtrace_on_warning() const
std::string default_warning_state()
void set_debug_on_caught(bool flag)
void display_exception(const execution_exception &ee) const
bool debug_on_warning(bool flag)
std::string last_error_message(const std::string &s)
void set_warning_options(const octave_map &val)
OCTAVE_NORETURN void panic(const char *fmt,...)
void set_last_error_message(const std::string &val)
void set_debug_on_error(bool flag)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
void warning(const char *fmt,...)
OCTAVE_NORETURN void panic(const char *fmt,...)
void warning_with_id(const char *id, const char *fmt,...)
OCTAVE_NORETURN void vusage_with_id(const char *id, const char *fmt, va_list args)
void interpreter_try(octave::unwind_protect &)
OCTAVE_NORETURN void verror_with_cfn(const char *fmt, va_list args)
void vwarning(const char *fmt, va_list args)
OCTAVE_NORETURN void vpanic(const char *fmt, va_list args)
void vwarning_with_id(const char *id, const char *fmt, va_list args)
OCTAVE_NORETURN void usage_with_id(const char *id, const char *fmt,...)
OCTAVE_NORETURN void error_with_id_cfn(const char *id, const char *fmt,...)
OCTAVE_NORETURN void verror_with_id(const char *id, const char *fmt, va_list args)
OCTAVE_NORETURN void error(const char *fmt,...)
OCTAVE_NORETURN void error_with_id(const char *id, const char *fmt,...)
OCTAVE_NORETURN void verror(const char *fmt, va_list args)
OCTAVE_NORETURN void error_with_cfn(const char *fmt,...)
OCTAVE_NORETURN void verror_with_id_cfn(const char *id, const char *fmt, va_list args)
void defun_usage_message(const std::string &msg)
Helper function for print_usage defined in defun.cc.
OCTAVE_NORETURN void parse_error(const char *fmt,...)
void message(const char *name, const char *fmt,...)
OCTAVE_NORETURN void vparse_error(const char *fmt, va_list args)
OCTAVE_NORETURN void vparse_error_with_id(const char *id, const char *fmt, va_list args)
octave_value_list set_warning_state(const std::string &id, const std::string &state)
void vmessage(const char *name, const char *fmt, va_list args)
void disable_warning(const std::string &id)
OCTAVE_NORETURN void parse_error_with_id(const char *id, const char *fmt,...)
int warning_enabled(const std::string &id)