#include "error.h"
Public Member Functions | |
error_system (const error_system &)=delete | |
OCTINTERP_API | error_system (interpreter &interp) |
~error_system (void)=default | |
bool | backtrace_on_warning (bool flag) |
OCTINTERP_API octave_value | backtrace_on_warning (const octave_value_list &args, int nargout) |
bool | backtrace_on_warning (void) const |
bool | beep_on_error (bool flag) |
OCTINTERP_API octave_value | beep_on_error (const octave_value_list &args, int nargout) |
bool | beep_on_error (void) const |
bool | debug_on_caught (bool flag) |
OCTINTERP_API octave_value | debug_on_caught (const octave_value_list &args, int nargout) |
bool | debug_on_caught (void) const |
bool | debug_on_error (bool flag) |
OCTINTERP_API octave_value | debug_on_error (const octave_value_list &args, int nargout) |
bool | debug_on_error (void) const |
bool | debug_on_warning (bool flag) |
OCTINTERP_API octave_value | debug_on_warning (const octave_value_list &args, int nargout) |
bool | debug_on_warning (void) const |
OCTINTERP_API std::string | default_warning_state (void) |
OCTINTERP_API void | disable_warning (const std::string &id) |
bool | discard_warning_messages (bool flag) |
OCTINTERP_API octave_value | discard_warning_messages (const octave_value_list &args, int nargout) |
bool | discard_warning_messages (void) const |
OCTINTERP_API void | display_exception (const execution_exception &ee) const |
OCTINTERP_API void | display_exception (const execution_exception &ee, std::ostream &os) const |
OCTINTERP_API void | display_warning_options (std::ostream &os) |
OCTAVE_NORETURN OCTINTERP_API void | error_1 (const char *id, const char *fmt, va_list args) |
OCTAVE_NORETURN OCTINTERP_API void | error_1 (execution_exception &ee, const char *id, const char *fmt, va_list args) |
OCTINTERP_API void | initialize_default_warning_state (void) |
OCTINTERP_API void | interpreter_try (unwind_protect &frame) |
OCTINTERP_API octave_value | last_error_id (const octave_value_list &args, int nargout) |
std::string | last_error_id (const std::string &s) |
std::string | last_error_id (void) const |
OCTINTERP_API octave_value | last_error_message (const octave_value_list &args, int nargout) |
std::string | last_error_message (const std::string &s) |
std::string | last_error_message (void) const |
octave_map | last_error_stack (const octave_map &new_val) |
octave_map | last_error_stack (void) const |
OCTINTERP_API octave_value | last_warning_id (const octave_value_list &args, int nargout) |
std::string | last_warning_id (const std::string &s) |
std::string | last_warning_id (void) const |
OCTINTERP_API octave_value | last_warning_message (const octave_value_list &args, int nargout) |
std::string | last_warning_message (const std::string &s) |
std::string | last_warning_message (void) const |
error_system & | operator= (const error_system &)=delete |
OCTAVE_NORETURN OCTINTERP_API void | panic (const char *fmt,...) |
bool | quiet_warning (bool flag) |
OCTINTERP_API octave_value | quiet_warning (const octave_value_list &args, int nargout) |
bool | quiet_warning (void) const |
OCTAVE_NORETURN OCTINTERP_API void | rethrow_error (const std::string &id, const std::string &msg, const octave_map &stack) |
OCTINTERP_API void | save_exception (const execution_exception &ee) |
void | set_backtrace_on_warning (bool flag) |
void | set_beep_on_error (bool flag) |
void | set_debug_on_caught (bool flag) |
void | set_debug_on_error (bool flag) |
void | set_debug_on_warning (bool flag) |
void | set_discard_warning_messages (bool flag) |
void | set_last_error_id (const std::string &val) |
void | set_last_error_message (const std::string &val) |
void | set_last_error_stack (const octave_map &val) |
void | set_last_warning_id (const std::string &val) |
void | set_last_warning_message (const std::string &val) |
void | set_quiet_warning (bool flag) |
void | set_verbose_warning (bool flag) |
OCTINTERP_API void | set_warning_option (const std::string &state, const std::string &id) |
void | set_warning_options (const octave_map &val) |
OCTAVE_NORETURN OCTINTERP_API 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_NORETURN OCTINTERP_API void | throw_error (execution_exception &ee) |
bool | verbose_warning (bool flag) |
OCTINTERP_API octave_value | verbose_warning (const octave_value_list &args, int nargout) |
bool | verbose_warning (void) const |
OCTINTERP_API 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) |
OCTAVE_NORETURN OCTINTERP_API void | vpanic (const char *fmt, va_list args) |
OCTAVE_NORETURN OCTINTERP_API void | vusage (const char *id, const char *fmt, va_list args) |
OCTINTERP_API void | vwarning (const char *id, const char *fmt, va_list args) |
OCTINTERP_API void | vwarning (const char *name, const char *id, const char *fmt, va_list args) |
OCTINTERP_API 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 be an error instead of a warning. More... | |
octave_map | warning_options (const octave_map &new_val) |
octave_map | warning_options (void) const |
OCTINTERP_API octave_scalar_map | warning_query (const std::string &id_arg) |
Static Public Member Functions | |
static OCTINTERP_API std::list< frame_info > | make_stack_frame_list (const octave_map &stack) |
static OCTINTERP_API octave_map | make_stack_map (const std::list< frame_info > &frames) |
Private Attributes | |
bool | m_backtrace_on_warning |
TRUE means that Octave will try to display a stack trace when a warning is encountered. More... | |
bool | m_beep_on_error |
TRUE means that Octave will try to beep obnoxiously before printing error messages. More... | |
bool | m_debug_on_caught |
TRUE means that Octave will try to enter the debugger when an error is encountered within the 'try' section of a 'try' / 'catch' block. More... | |
bool | m_debug_on_error |
TRUE means that Octave will try to enter the debugger when an error is encountered. More... | |
bool | m_debug_on_warning |
TRUE means that Octave will try to enter the debugger when a warning is encountered. More... | |
bool | m_discard_warning_messages |
TRUE means warning messages are turned off. More... | |
interpreter & | m_interpreter |
std::string | m_last_error_id |
The last error message id. More... | |
std::string | m_last_error_message |
The text of the last error message. More... | |
octave_map | m_last_error_stack |
The last file in which an error occurred. More... | |
std::string | m_last_warning_id |
The last warning message id. More... | |
std::string | m_last_warning_message |
The text of the last warning message. More... | |
bool | m_quiet_warning |
TRUE means that Octave will print no warnings, but lastwarn will be updated. More... | |
bool | m_verbose_warning |
TRUE means that Octave will print a verbose warning. More... | |
octave_map | m_warning_options |
A structure containing (most of) the current state of warnings. More... | |
error_system::error_system | ( | interpreter & | interp | ) |
Definition at line 257 of file error.cc.
References initialize_default_warning_state().
|
delete |
|
default |
|
inline |
Definition at line 140 of file error.h.
References m_backtrace_on_warning.
octave_value error_system::backtrace_on_warning | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 314 of file error.cc.
References m_backtrace_on_warning, and set_internal_variable().
Referenced by Fwarning().
|
inline |
Definition at line 138 of file error.h.
References m_backtrace_on_warning.
Referenced by vwarning().
|
inline |
Definition at line 126 of file error.h.
References m_beep_on_error.
octave_value error_system::beep_on_error | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 307 of file error.cc.
References m_beep_on_error, and set_internal_variable().
Referenced by Fbeep_on_error(), and interpreter::maximum_braindamage().
|
inline |
Definition at line 124 of file error.h.
References m_beep_on_error.
|
inline |
Definition at line 78 of file error.h.
References m_debug_on_caught.
octave_value error_system::debug_on_caught | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 285 of file error.cc.
References m_debug_on_caught, and set_internal_variable().
Referenced by bp_table::dbclear_all_signals(), bp_table::dbstop_process_map_args(), bp_table::set_stop_flag(), bp_table::stop_on_err_warn_status(), and tree_evaluator::visit_statement().
|
inline |
Definition at line 76 of file error.h.
References m_debug_on_caught.
|
inline |
Definition at line 64 of file error.h.
References m_debug_on_error.
octave_value error_system::debug_on_error | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 278 of file error.cc.
References m_debug_on_error, and set_internal_variable().
Referenced by bp_table::dbclear_all_signals(), bp_table::dbstop_process_map_args(), tree_evaluator::enter_debugger(), Fdebug_on_error(), bp_table::set_stop_flag(), bp_table::stop_on_err_warn_status(), and tree_evaluator::visit_statement().
|
inline |
Definition at line 62 of file error.h.
References m_debug_on_error.
|
inline |
Definition at line 92 of file error.h.
References m_debug_on_warning.
octave_value error_system::debug_on_warning | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 292 of file error.cc.
References m_debug_on_warning, and set_internal_variable().
Referenced by bp_table::dbclear_all_signals(), bp_table::dbstop_process_map_args(), tree_evaluator::enter_debugger(), Fdebug_on_warning(), Fwarning(), bp_table::set_stop_flag(), and bp_table::stop_on_err_warn_status().
|
inline |
std::string error_system::default_warning_state | ( | void | ) |
Definition at line 700 of file error.cc.
References octave_map::contents(), Array< T, Alloc >::numel(), state, and warning_options().
Referenced by display_warning_options(), and set_warning_option().
void error_system::disable_warning | ( | const std::string & | id | ) |
Definition at line 827 of file error.cc.
References set_warning_option().
Referenced by disable_warning(), initialize_default_warning_state(), and interpreter::maximum_braindamage().
|
inline |
Definition at line 112 of file error.h.
References m_discard_warning_messages.
octave_value error_system::discard_warning_messages | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 299 of file error.cc.
References m_discard_warning_messages, and set_internal_variable().
Referenced by base_parser::finish_array_list(), generate_struct_completions(), and base_parser::make_colon_expression().
|
inline |
Definition at line 107 of file error.h.
References m_discard_warning_messages.
Referenced by vwarning().
void error_system::display_exception | ( | const execution_exception & | ee | ) | const |
Definition at line 915 of file error.cc.
References event_manager::display_exception(), interpreter::get_event_manager(), m_beep_on_error, m_interpreter, and octave_diary.
void error_system::display_exception | ( | const execution_exception & | ee, |
std::ostream & | os | ||
) | const |
Definition at line 905 of file error.cc.
References m_beep_on_error, and octave_diary.
Referenced by tree_evaluator::get_line_and_eval(), interpreter::handle_exception(), debugger::repl(), tree_evaluator::repl(), debugger::server_loop(), tree_evaluator::server_loop(), and tree_evaluator::visit_statement().
void error_system::display_warning_options | ( | std::ostream & | os | ) |
Definition at line 723 of file error.cc.
References octave_map::contents(), default_warning_state(), Array< T, Alloc >::numel(), panic_impossible, state, and warning_options().
Referenced by Fwarning().
void error_system::error_1 | ( | const char * | id, |
const char * | fmt, | ||
va_list | args | ||
) |
Definition at line 573 of file error.cc.
References format_message(), message(), and throw_error().
void error_system::error_1 | ( | execution_exception & | ee, |
const char * | id, | ||
const char * | fmt, | ||
va_list | args | ||
) |
Definition at line 564 of file error.cc.
References format_message(), and throw_error().
Referenced by vwarning().
void error_system::initialize_default_warning_state | ( | void | ) |
Definition at line 832 of file error.cc.
References disable_warning(), init_warning_options(), and warning_options().
Referenced by error_system().
void error_system::interpreter_try | ( | unwind_protect & | frame | ) |
Definition at line 852 of file error.cc.
References m_debug_on_error, m_debug_on_warning, and action_container::protect_var().
Referenced by interpreter_try().
octave_value error_system::last_error_id | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 358 of file error.cc.
References m_last_error_id, and set_internal_variable().
Referenced by Flasterr(), Flasterror(), get_output_list(), tree_evaluator::visit_statement(), and tree_evaluator::visit_try_catch_command().
|
inline |
Definition at line 240 of file error.h.
References m_last_error_id.
|
inline |
octave_value error_system::last_error_message | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 336 of file error.cc.
References m_last_error_message, and set_internal_variable().
Referenced by Flasterr(), Flasterror(), get_output_list(), and tree_evaluator::visit_try_catch_command().
|
inline |
Definition at line 195 of file error.h.
References m_last_error_message.
|
inline |
Definition at line 193 of file error.h.
References m_last_error_message.
Referenced by save_exception().
|
inline |
Definition at line 254 of file error.h.
References m_last_error_stack.
|
inline |
Definition at line 252 of file error.h.
References m_last_error_stack.
Referenced by Flasterror(), save_exception(), and tree_evaluator::visit_try_catch_command().
octave_value error_system::last_warning_id | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 351 of file error.cc.
References m_last_warning_id, and set_internal_variable().
Referenced by Flastwarn(), and Fwarning().
|
inline |
Definition at line 226 of file error.h.
References m_last_warning_id.
|
inline |
Definition at line 224 of file error.h.
References m_last_warning_id.
Referenced by vwarning(), and warning_query().
octave_value error_system::last_warning_message | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 343 of file error.cc.
References m_last_warning_message, and set_internal_variable().
Referenced by base_parser::finish_array_list(), Flastwarn(), Fwarning(), and base_parser::make_colon_expression().
|
inline |
Definition at line 211 of file error.h.
References m_last_warning_message.
|
inline |
Definition at line 208 of file error.h.
References m_last_warning_message.
Referenced by vwarning().
|
static |
Definition at line 399 of file error.cc.
References octave_map::contents(), and Array< T, Alloc >::numel().
Referenced by Ferror(), and rethrow_error().
|
static |
Definition at line 372 of file error.cc.
References bt_fields, Cell::column(), and octave_map::contents().
Referenced by save_exception().
|
delete |
void error_system::panic | ( | const char * | fmt, |
... | |||
) |
|
inline |
Definition at line 168 of file error.h.
References m_quiet_warning.
octave_value error_system::quiet_warning | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 329 of file error.cc.
References m_quiet_warning, and set_internal_variable().
Referenced by Fwarning().
|
inline |
void error_system::rethrow_error | ( | const std::string & | id, |
const std::string & | msg, | ||
const octave_map & | stack | ||
) |
Definition at line 597 of file error.cc.
References octave_map::contains(), error(), octave_map::isempty(), make_stack_frame_list(), octave_map::setfield(), and throw_error().
Referenced by Frethrow().
void error_system::save_exception | ( | const execution_exception & | ee | ) |
Definition at line 893 of file error.cc.
References last_error_id(), last_error_message(), last_error_stack(), make_stack_map(), and message().
Referenced by tree_evaluator::do_unwind_protect_cleanup_code(), tree_evaluator::eval(), tree_evaluator::evalin(), tree_evaluator::get_line_and_eval(), get_output_list(), interpreter::handle_exception(), debugger::repl(), tree_evaluator::repl(), debugger::server_loop(), tree_evaluator::server_loop(), tree_evaluator::visit_statement(), tree_evaluator::visit_try_catch_command(), and tree_evaluator::visit_unwind_protect_command().
|
inline |
Definition at line 136 of file error.h.
References m_backtrace_on_warning.
|
inline |
Definition at line 122 of file error.h.
References m_beep_on_error.
|
inline |
Definition at line 74 of file error.h.
References m_debug_on_caught.
|
inline |
Definition at line 60 of file error.h.
References m_debug_on_error.
Referenced by tree_evaluator::enter_debugger().
|
inline |
Definition at line 88 of file error.h.
References m_debug_on_warning.
Referenced by tree_evaluator::enter_debugger().
|
inline |
Definition at line 102 of file error.h.
References m_discard_warning_messages.
Referenced by base_parser::finish_array_list(), generate_struct_completions(), and base_parser::make_colon_expression().
|
inline |
Definition at line 236 of file error.h.
References m_last_error_id.
|
inline |
Definition at line 190 of file error.h.
References m_last_error_message.
|
inline |
Definition at line 247 of file error.h.
References m_last_error_stack.
|
inline |
Definition at line 221 of file error.h.
References m_last_warning_id.
|
inline |
Definition at line 205 of file error.h.
References m_last_warning_message.
Referenced by base_parser::finish_array_list(), and base_parser::make_colon_expression().
|
inline |
Definition at line 164 of file error.h.
References m_quiet_warning.
|
inline |
Definition at line 150 of file error.h.
References m_verbose_warning.
void error_system::set_warning_option | ( | const std::string & | state, |
const std::string & | id | ||
) |
Definition at line 763 of file error.cc.
References octave_map::assign(), octave_map::clear(), octave_map::contents(), default_warning_state(), error(), Array< T, Alloc >::numel(), Array< T, Alloc >::resize(), state, and warning_options().
Referenced by disable_warning(), and Fwarning().
|
inline |
Definition at line 177 of file error.h.
References m_warning_options.
void error_system::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> () |
||
) |
Definition at line 864 of file error.cc.
References tree_evaluator::backtrace_info(), interpreter::get_evaluator(), m_interpreter, and message().
Referenced by error_1(), Ferror(), rethrow_error(), and vusage().
void error_system::throw_error | ( | execution_exception & | ee | ) |
|
inline |
Definition at line 154 of file error.h.
References m_verbose_warning.
octave_value error_system::verbose_warning | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 322 of file error.cc.
References m_verbose_warning, and set_internal_variable().
Referenced by Fwarning().
|
inline |
Definition at line 152 of file error.h.
References m_verbose_warning.
OCTINTERP_API void error_system::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 error_system::vpanic | ( | const char * | fmt, |
va_list | args | ||
) |
void error_system::vusage | ( | const char * | id, |
const char * | fmt, | ||
va_list | args | ||
) |
Definition at line 495 of file error.cc.
References format_message(), message(), and throw_error().
void error_system::vwarning | ( | const char * | id, |
const char * | fmt, | ||
va_list | args | ||
) |
Definition at line 583 of file error.cc.
References error_1(), vwarning(), and warning_enabled().
void error_system::vwarning | ( | const char * | name, |
const char * | id, | ||
const char * | fmt, | ||
va_list | args | ||
) |
Definition at line 503 of file error.cc.
References tree_evaluator::backtrace_message(), backtrace_on_warning(), bp_table::debug_on_warn(), debug_on_warning(), discard_warning_messages(), tree_evaluator::enter_debugger(), flush_stdout(), application::forced_interactive(), format_message(), tree_evaluator::get_bp_table(), interpreter::get_evaluator(), tree_evaluator::in_user_code(), interpreter::interactive(), last_warning_id(), last_warning_message(), m_debug_on_warning, m_interpreter, octave_diary, quiet_warning(), and strlen().
Referenced by vwarning().
int error_system::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 be an error instead of a warning.
Definition at line 423 of file error.cc.
References check_state(), octave_map::contents(), octave_map::numel(), state, octave_value::string_value(), and warning_options().
Referenced by vwarning(), and warning_enabled().
|
inline |
Definition at line 180 of file error.h.
References m_warning_options.
|
inline |
Definition at line 175 of file error.h.
References m_warning_options.
Referenced by default_warning_state(), display_warning_options(), Fwarning(), initialize_default_warning_state(), set_warning_option(), warning_enabled(), and warning_query().
octave_scalar_map error_system::warning_query | ( | const std::string & | id_arg | ) |
Definition at line 644 of file error.cc.
References octave_scalar_map::assign(), octave_map::contents(), last_warning_id(), Array< T, Alloc >::numel(), panic_if(), panic_unless(), state, and warning_options().
Referenced by Fwarning().
|
private |
TRUE means that Octave will try to display a stack trace when a warning is encountered.
Definition at line 376 of file error.h.
Referenced by backtrace_on_warning(), and set_backtrace_on_warning().
|
private |
TRUE means that Octave will try to beep obnoxiously before printing error messages.
Definition at line 372 of file error.h.
Referenced by beep_on_error(), display_exception(), and set_beep_on_error().
|
private |
TRUE means that Octave will try to enter the debugger when an error is encountered within the 'try' section of a 'try' / 'catch' block.
Definition at line 359 of file error.h.
Referenced by debug_on_caught(), and set_debug_on_caught().
|
private |
TRUE means that Octave will try to enter the debugger when an error is encountered.
This will also inhibit printing of the normal traceback message (you will only see the top-level error message).
Definition at line 354 of file error.h.
Referenced by debug_on_error(), interpreter_try(), and set_debug_on_error().
|
private |
TRUE means that Octave will try to enter the debugger when a warning is encountered.
Definition at line 364 of file error.h.
Referenced by debug_on_warning(), interpreter_try(), set_debug_on_warning(), and vwarning().
|
private |
TRUE means warning messages are turned off.
Definition at line 368 of file error.h.
Referenced by discard_warning_messages(), and set_discard_warning_messages().
|
private |
Definition at line 348 of file error.h.
Referenced by display_exception(), throw_error(), and vwarning().
|
private |
The last error message id.
Definition at line 399 of file error.h.
Referenced by last_error_id(), and set_last_error_id().
|
private |
The text of the last error message.
Definition at line 390 of file error.h.
Referenced by last_error_message(), and set_last_error_message().
|
private |
The last file in which an error occurred.
Definition at line 402 of file error.h.
Referenced by last_error_stack(), and set_last_error_stack().
|
private |
The last warning message id.
Definition at line 396 of file error.h.
Referenced by last_warning_id(), and set_last_warning_id().
|
private |
The text of the last warning message.
Definition at line 393 of file error.h.
Referenced by last_warning_message(), and set_last_warning_message().
|
private |
TRUE means that Octave will print no warnings, but lastwarn will be updated.
Definition at line 384 of file error.h.
Referenced by quiet_warning(), and set_quiet_warning().
|
private |
TRUE means that Octave will print a verbose warning.
Currently unused.
Definition at line 380 of file error.h.
Referenced by set_verbose_warning(), and verbose_warning().
|
private |
A structure containing (most of) the current state of warnings.
Definition at line 387 of file error.h.
Referenced by set_warning_options(), and warning_options().