26 #if ! defined (octave_error_h)
27 #define octave_error_h 1
29 #include "octave-config.h"
244 static std::list<octave::frame_info>
253 void verror (
bool save_last_error, std::ostream& os,
const char *
name,
254 const char *
id,
const char *fmt, va_list args,
255 bool with_cfn =
false);
257 void vwarning (
const char *
name,
const char *
id,
const char *fmt,
265 void error_1 (
const char *
id,
const char *fmt, va_list args);
268 void vusage (
const char *
id,
const char *fmt, va_list args);
270 void vwarning (
const char *
id,
const char *fmt, va_list args);
273 void rethrow_error (
const std::string&
id,
const std::string& msg,
277 void vpanic (
const char *fmt, va_list args);
280 void panic (
const char *fmt, ...);
301 const std::string&
id,
303 const std::list<frame_info>& stack_info
304 = std::list<frame_info> ());
312 std::ostream& os)
const;
380 #define panic_impossible() \
381 panic ("impossible state reached in file '%s' at line %d", __FILE__, __LINE__)
385 extern OCTINTERP_API
void
386 vmessage (
const char *
name,
const char *fmt, va_list args);
388 OCTAVE_FORMAT_PRINTF (2, 3)
389 extern OCTINTERP_API
void message (const
char *
name, const
char *fmt, ...);
391 extern OCTINTERP_API
void vwarning (const
char *fmt, va_list args);
393 OCTAVE_FORMAT_PRINTF (1, 2)
394 extern OCTINTERP_API
void warning (const
char *fmt, ...);
397 extern OCTINTERP_API
void verror (const
char *fmt, va_list args);
399 OCTAVE_FORMAT_PRINTF (1, 2)
401 extern OCTINTERP_API
void error (const
char *fmt, ...);
404 extern OCTINTERP_API
void
407 OCTAVE_FORMAT_PRINTF (2, 3)
409 extern OCTINTERP_API
void
413 extern OCTINTERP_API
void
416 OCTAVE_FORMAT_PRINTF (1, 2)
418 extern OCTINTERP_API
void
422 extern OCTINTERP_API
void
425 OCTAVE_FORMAT_PRINTF (1, 2)
427 extern OCTINTERP_API
void
431 extern OCTINTERP_API
void
434 OCTAVE_FORMAT_PRINTF (2, 3)
436 extern OCTINTERP_API
void
439 extern OCTINTERP_API
void
442 OCTAVE_FORMAT_PRINTF (2, 3)
443 extern OCTINTERP_API
void
447 extern OCTINTERP_API
void
450 OCTAVE_FORMAT_PRINTF (2, 3)
452 extern OCTINTERP_API
void
456 extern OCTINTERP_API
void
459 OCTAVE_FORMAT_PRINTF (2, 3)
461 extern OCTINTERP_API
void
465 extern OCTINTERP_API
void
468 OCTAVE_FORMAT_PRINTF (2, 3)
470 extern OCTINTERP_API
void
474 extern OCTINTERP_API
void vpanic (const
char *fmt, va_list args);
476 OCTAVE_FORMAT_PRINTF (1, 2)
478 extern OCTINTERP_API
void panic (const
char *fmt, ...);
494 OCTAVE_DEPRECATED (6, "this variable is obsolete and always has the value 0")
497 OCTAVE_DEPRECATED (6, "this function is obsolete and should not be needed")
bool beep_on_error(bool flag)
std::string m_last_warning_message
The text of the last warning message.
bool m_discard_warning_messages
TRUE means warning messages are turned off.
std::string last_error_message(void) const
void set_warning_options(const octave_map &val)
void vwarning(const char *name, const char *id, const char *fmt, va_list args)
octave_map warning_options(const octave_map &new_val)
void disable_warning(const std::string &id)
void save_exception(const execution_exception &e)
void set_quiet_warning(bool flag)
void initialize_default_warning_state(void)
void display_warning_options(std::ostream &os)
void set_backtrace_on_warning(bool flag)
std::string default_warning_state(void)
void set_debug_on_warning(bool flag)
std::string last_warning_message(const std::string &s)
bool m_backtrace_on_warning
TRUE means that Octave will try to display a stack trace when a warning is encountered.
bool backtrace_on_warning(void) const
std::string m_last_warning_id
The last warning message id.
void set_last_error_message(const std::string &val)
void set_debug_on_caught(bool flag)
void set_warning_option(const std::string &state, const std::string &id)
octave_scalar_map warning_query(const std::string &id_arg)
bool debug_on_error(bool flag)
std::string m_last_error_message
The text of the last error message.
void set_discard_warning_messages(bool flag)
std::string m_last_error_id
The last error message id.
std::string last_error_id(const std::string &s)
void display_exception(const execution_exception &e, std::ostream &os) const
bool discard_warning_messages(bool flag)
std::string last_error_id(void) const
bool debug_on_caught(void) const
void set_verbose_warning(bool flag)
octave_map last_error_stack(const octave_map &new_val)
octave_map m_warning_options
A structure containing (most of) the current state of warnings.
bool beep_on_error(void) const
bool debug_on_warning(bool flag)
bool m_quiet_warning
TRUE means that Octave will print no warnings, but lastwarn will be updated.
~error_system(void)=default
OCTAVE_NORETURN void vusage(const char *id, const char *fmt, va_list args)
OCTAVE_NORETURN void panic(const char *fmt,...)
bool discard_warning_messages(void) const
bool m_debug_on_warning
TRUE means that Octave will try to enter the debugger when a warning is encountered.
error_system & operator=(const error_system &)=delete
bool m_verbose_warning
TRUE means that Octave will print a verbose warning.
void set_debug_on_error(bool flag)
OCTAVE_NORETURN void vpanic(const char *fmt, va_list args)
octave_map warning_options(void) const
void set_last_error_stack(const octave_map &val)
void set_beep_on_error(bool flag)
static std::list< octave::frame_info > make_stack_frame_list(const octave_map &stack)
OCTAVE_NORETURN void rethrow_error(const std::string &id, const std::string &msg, const octave_map &stack)
std::string last_warning_message(void) const
bool m_debug_on_error
TRUE means that Octave will try to enter the debugger when an error is encountered.
bool debug_on_error(void) const
octave_map last_error_stack(void) const
octave_map m_last_error_stack
The last file in which an error occurred.
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)
error_system(const error_system &)=delete
OCTAVE_NORETURN void error_1(execution_exception &e, const char *id, const char *fmt, va_list args)
bool m_beep_on_error
TRUE means that Octave will try to beep obnoxiously before printing error messages.
bool verbose_warning(bool flag)
void set_last_error_id(const std::string &val)
std::string last_warning_id(void) const
bool debug_on_caught(bool flag)
bool m_debug_on_caught
TRUE means that Octave will try to enter the debugger when an error is encountered within the 'try' s...
bool quiet_warning(bool flag)
bool verbose_warning(void) const
bool debug_on_warning(void) const
bool quiet_warning(void) const
void interpreter_try(octave::unwind_protect &frame)
void set_last_warning_id(const std::string &val)
error_system(interpreter &interp)
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 >())
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...
interpreter & m_interpreter
bool backtrace_on_warning(bool flag)
static octave_map make_stack_map(const std::list< octave::frame_info > &frames)
std::string last_warning_id(const std::string &s)
std::string last_error_message(const std::string &s)
void set_last_warning_message(const std::string &val)
OCTAVE_NORETURN OCTINTERP_API void vparse_error_with_id(const char *id, const char *fmt, va_list args)
OCTINTERP_API void defun_usage_message(const std::string &msg)
Helper function for print_usage defined in defun.cc.
void reset_error_handler(void)
OCTINTERP_API void warning(const char *fmt,...)
OCTAVE_NORETURN OCTINTERP_API void usage_with_id(const char *id, const char *fmt,...)
OCTAVE_NORETURN OCTINTERP_API void parse_error_with_id(const char *id, const char *fmt,...)
OCTINTERP_API void vmessage(const char *name, const char *fmt, va_list args)
OCTINTERP_API octave_value_list set_warning_state(const std::string &id, const std::string &state)
OCTINTERP_API void disable_warning(const std::string &id)
OCTINTERP_API void message(const char *name, const char *fmt,...)
OCTAVE_NORETURN OCTINTERP_API void error_with_cfn(const char *fmt,...)
OCTAVE_NORETURN OCTINTERP_API void parse_error(const char *fmt,...)
OCTAVE_NORETURN OCTINTERP_API void error_with_id(const char *id, const char *fmt,...)
OCTAVE_NORETURN OCTINTERP_API void vparse_error(const char *fmt, va_list args)
OCTAVE_NORETURN OCTINTERP_API void verror(const char *fmt, va_list args)
OCTINTERP_API int warning_enabled(const std::string &id)
OCTINTERP_API int error_state
OCTAVE_NORETURN OCTINTERP_API void verror_with_id_cfn(const char *id, const char *fmt, va_list args)
OCTAVE_NORETURN OCTINTERP_API void verror_with_cfn(const char *fmt, va_list args)
OCTINTERP_API void interpreter_try(octave::unwind_protect &)
OCTAVE_NORETURN OCTINTERP_API void vusage_with_id(const char *id, const char *fmt, va_list args)
OCTINTERP_API void warning_with_id(const char *id, const char *fmt,...)
OCTINTERP_API void vwarning(const char *fmt, va_list args)
OCTAVE_NORETURN OCTINTERP_API void panic(const char *fmt,...)
OCTAVE_NORETURN OCTINTERP_API void error(const char *fmt,...)
OCTAVE_NORETURN OCTINTERP_API void error_with_id_cfn(const char *id, const char *fmt,...)
OCTAVE_NORETURN OCTINTERP_API void vpanic(const char *fmt, va_list args)
OCTINTERP_API void vwarning_with_id(const char *id, const char *fmt, va_list args)
OCTAVE_NORETURN OCTINTERP_API void verror_with_id(const char *id, const char *fmt, va_list args)
static uint32_t state[624]