#include "error.h"
Public Member Functions | |
error_system (const error_system &)=delete | |
error_system (interpreter &interp) | |
~error_system (void)=default | |
bool | backtrace_on_warning (bool flag) |
octave_value | backtrace_on_warning (const octave_value_list &args, int nargout) |
bool | backtrace_on_warning (void) const |
bool | beep_on_error (bool flag) |
octave_value | beep_on_error (const octave_value_list &args, int nargout) |
bool | beep_on_error (void) const |
bool | debug_on_caught (bool flag) |
octave_value | debug_on_caught (const octave_value_list &args, int nargout) |
bool | debug_on_caught (void) const |
bool | debug_on_error (bool flag) |
octave_value | debug_on_error (const octave_value_list &args, int nargout) |
bool | debug_on_error (void) const |
bool | debug_on_warning (bool flag) |
octave_value | debug_on_warning (const octave_value_list &args, int nargout) |
bool | debug_on_warning (void) const |
std::string | default_warning_state (void) |
void | disable_warning (const std::string &id) |
bool | discard_warning_messages (bool flag) |
octave_value | discard_warning_messages (const octave_value_list &args, int nargout) |
bool | discard_warning_messages (void) const |
void | display_exception (const execution_exception &e, std::ostream &os) const |
void | display_warning_options (std::ostream &os) |
OCTAVE_NORETURN void | error_1 (const char *id, const char *fmt, va_list args) |
OCTAVE_NORETURN void | error_1 (execution_exception &e, const char *id, const char *fmt, va_list args) |
void | initialize_default_warning_state (void) |
void | interpreter_try (octave::unwind_protect &frame) |
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 |
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 |
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 |
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 void | panic (const char *fmt,...) |
bool | quiet_warning (bool flag) |
octave_value | quiet_warning (const octave_value_list &args, int nargout) |
bool | quiet_warning (void) const |
OCTAVE_NORETURN void | rethrow_error (const std::string &id, const std::string &msg, const octave_map &stack) |
void | save_exception (const execution_exception &e) |
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) |
void | set_warning_option (const std::string &state, const std::string &id) |
void | set_warning_options (const octave_map &val) |
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_NORETURN void | throw_error (execution_exception &e) |
bool | verbose_warning (bool flag) |
octave_value | verbose_warning (const octave_value_list &args, int nargout) |
bool | verbose_warning (void) 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) |
OCTAVE_NORETURN void | vpanic (const char *fmt, va_list args) |
OCTAVE_NORETURN void | vusage (const char *id, const char *fmt, va_list args) |
void | vwarning (const char *id, const char *fmt, va_list args) |
void | vwarning (const char *name, const char *id, const char *fmt, va_list args) |
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 |
octave_scalar_map | warning_query (const std::string &id_arg) |
Static Public Member Functions | |
static std::list< octave::frame_info > | make_stack_frame_list (const octave_map &stack) |
static octave_map | make_stack_map (const std::list< octave::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... | |
octave::error_system::error_system | ( | interpreter & | interp | ) |
Definition at line 256 of file error.cc.
References initialize_default_warning_state().
|
delete |
|
default |
|
inline |
Definition at line 131 of file error.h.
References m_backtrace_on_warning.
octave_value octave::error_system::backtrace_on_warning | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 313 of file error.cc.
References m_backtrace_on_warning, and set_internal_variable().
Referenced by Fwarning().
|
inline |
Definition at line 129 of file error.h.
References m_backtrace_on_warning.
Referenced by vwarning().
|
inline |
Definition at line 118 of file error.h.
References m_beep_on_error.
octave_value octave::error_system::beep_on_error | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 306 of file error.cc.
References m_beep_on_error, and set_internal_variable().
Referenced by Fbeep_on_error(), and octave::interpreter::maximum_braindamage().
|
inline |
Definition at line 116 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 octave::error_system::debug_on_caught | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 284 of file error.cc.
References m_debug_on_caught, and set_internal_variable().
Referenced by octave::bp_table::dbclear_all_signals(), octave::bp_table::dbstop_process_map_args(), octave::bp_table::set_stop_flag(), octave::bp_table::stop_on_err_warn_status(), and octave::tree_evaluator::visit_statement().
|
inline |
Definition at line 76 of file error.h.
References m_debug_on_caught.
|
inline |
Definition at line 65 of file error.h.
References m_debug_on_error.
octave_value octave::error_system::debug_on_error | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 277 of file error.cc.
References m_debug_on_error, and set_internal_variable().
Referenced by octave::bp_table::dbclear_all_signals(), octave::bp_table::dbstop_process_map_args(), octave::tree_evaluator::enter_debugger(), Fdebug_on_error(), octave::bp_table::set_stop_flag(), octave::bp_table::stop_on_err_warn_status(), and octave::tree_evaluator::visit_statement().
|
inline |
Definition at line 63 of file error.h.
References m_debug_on_error.
|
inline |
Definition at line 91 of file error.h.
References m_debug_on_warning.
octave_value octave::error_system::debug_on_warning | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 291 of file error.cc.
References m_debug_on_warning, and set_internal_variable().
Referenced by octave::bp_table::dbclear_all_signals(), octave::bp_table::dbstop_process_map_args(), octave::tree_evaluator::enter_debugger(), Fdebug_on_warning(), Fwarning(), octave::bp_table::set_stop_flag(), and octave::bp_table::stop_on_err_warn_status().
|
inline |
std::string octave::error_system::default_warning_state | ( | void | ) |
Definition at line 710 of file error.cc.
References octave_map::contents(), Array< T >::numel(), retval, octave::state, and warning_options().
Referenced by display_warning_options(), and set_warning_option().
void octave::error_system::disable_warning | ( | const std::string & | id | ) |
Definition at line 833 of file error.cc.
References set_warning_option().
Referenced by disable_warning(), and initialize_default_warning_state().
|
inline |
Definition at line 105 of file error.h.
References m_discard_warning_messages.
octave_value octave::error_system::discard_warning_messages | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 298 of file error.cc.
References m_discard_warning_messages, and set_internal_variable().
Referenced by octave::base_parser::finish_array_list(), and octave::base_parser::make_colon_expression().
|
inline |
Definition at line 103 of file error.h.
References m_discard_warning_messages.
Referenced by vwarning().
void octave::error_system::display_exception | ( | const execution_exception & | e, |
std::ostream & | os | ||
) | const |
Definition at line 910 of file error.cc.
References m_beep_on_error, and octave_diary.
Referenced by octave::interpreter::handle_exception(), octave::interpreter::main_loop(), octave::debugger::repl(), and octave::tree_evaluator::visit_statement().
void octave::error_system::display_warning_options | ( | std::ostream & | os | ) |
Definition at line 733 of file error.cc.
References octave_map::contents(), default_warning_state(), Array< T >::numel(), panic_impossible, octave::state, and warning_options().
Referenced by Fwarning().
void octave::error_system::error_1 | ( | const char * | id, |
const char * | fmt, | ||
va_list | args | ||
) |
Definition at line 592 of file error.cc.
References format_message(), message(), and throw_error().
void octave::error_system::error_1 | ( | execution_exception & | e, |
const char * | id, | ||
const char * | fmt, | ||
va_list | args | ||
) |
Definition at line 583 of file error.cc.
References format_message(), and throw_error().
Referenced by error_1(), and vwarning().
void octave::error_system::initialize_default_warning_state | ( | void | ) |
Definition at line 838 of file error.cc.
References disable_warning(), octave::init_warning_options(), and warning_options().
Referenced by error_system().
void octave::error_system::interpreter_try | ( | octave::unwind_protect & | frame | ) |
Definition at line 858 of file error.cc.
References m_debug_on_error, m_debug_on_warning, and octave::action_container::protect_var().
Referenced by octave::file_editor_tab::handle_dbstop_if(), and interpreter_try().
octave_value octave::error_system::last_error_id | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 357 of file error.cc.
References m_last_error_id, and set_internal_variable().
Referenced by Flasterr(), Flasterror(), get_output_list(), last_error_id(), octave::tree_evaluator::visit_statement(), and octave::tree_evaluator::visit_try_catch_command().
|
inline |
Definition at line 220 of file error.h.
References m_last_error_id.
|
inline |
octave_value octave::error_system::last_error_message | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 335 of file error.cc.
References m_last_error_message, and set_internal_variable().
Referenced by Flasterr(), Flasterror(), get_output_list(), last_error_message(), and octave::tree_evaluator::visit_try_catch_command().
|
inline |
Definition at line 181 of file error.h.
References m_last_error_message.
|
inline |
Definition at line 179 of file error.h.
References m_last_error_message.
Referenced by save_exception().
|
inline |
Definition at line 234 of file error.h.
References m_last_error_stack.
|
inline |
Definition at line 232 of file error.h.
References m_last_error_stack.
Referenced by Flasterror(), last_error_stack(), save_exception(), and octave::tree_evaluator::visit_try_catch_command().
octave_value octave::error_system::last_warning_id | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 350 of file error.cc.
References m_last_warning_id, and set_internal_variable().
Referenced by Flastwarn(), Fwarning(), and last_warning_id().
|
inline |
Definition at line 207 of file error.h.
References m_last_warning_id.
|
inline |
Definition at line 205 of file error.h.
References m_last_warning_id.
Referenced by vwarning(), and warning_query().
octave_value octave::error_system::last_warning_message | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 342 of file error.cc.
References m_last_warning_message, and set_internal_variable().
Referenced by octave::base_parser::finish_array_list(), Flastwarn(), Fwarning(), last_warning_message(), and octave::base_parser::make_colon_expression().
|
inline |
Definition at line 194 of file error.h.
References m_last_warning_message.
|
inline |
Definition at line 192 of file error.h.
References m_last_warning_message.
Referenced by vwarning().
|
static |
Definition at line 408 of file error.cc.
References octave_map::contains(), octave_map::contents(), and name.
Referenced by Ferror(), and rethrow_error().
|
static |
Definition at line 371 of file error.cc.
References line::line(), octave::bt_fields, name, and retval.
Referenced by save_exception().
|
delete |
void octave::error_system::panic | ( | const char * | fmt, |
... | |||
) |
|
inline |
Definition at line 157 of file error.h.
References m_quiet_warning.
octave_value octave::error_system::quiet_warning | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 328 of file error.cc.
References m_quiet_warning, and set_internal_variable().
Referenced by Fwarning().
|
inline |
void octave::error_system::rethrow_error | ( | const std::string & | id, |
const std::string & | msg, | ||
const octave_map & | stack | ||
) |
Definition at line 616 of file error.cc.
References octave_map::contains(), error(), octave_map::isempty(), make_stack_frame_list(), and throw_error().
Referenced by Frethrow().
void octave::error_system::save_exception | ( | const execution_exception & | e | ) |
Definition at line 899 of file error.cc.
References last_error_id(), last_error_message(), last_error_stack(), make_stack_map(), and message().
Referenced by octave::tree_evaluator::do_unwind_protect_cleanup_code(), octave::tree_evaluator::eval(), octave::tree_evaluator::evalin(), get_output_list(), octave::interpreter::handle_exception(), octave::interpreter::main_loop(), octave::debugger::repl(), octave::tree_evaluator::visit_statement(), octave::tree_evaluator::visit_try_catch_command(), and octave::tree_evaluator::visit_unwind_protect_command().
|
inline |
Definition at line 127 of file error.h.
References m_backtrace_on_warning.
|
inline |
Definition at line 114 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 61 of file error.h.
References m_debug_on_error.
Referenced by octave::tree_evaluator::enter_debugger().
|
inline |
Definition at line 87 of file error.h.
References m_debug_on_warning.
Referenced by octave::tree_evaluator::enter_debugger().
|
inline |
Definition at line 101 of file error.h.
References m_discard_warning_messages.
Referenced by octave::base_parser::finish_array_list(), and octave::base_parser::make_colon_expression().
|
inline |
Definition at line 216 of file error.h.
References m_last_error_id.
|
inline |
Definition at line 177 of file error.h.
References m_last_error_message.
|
inline |
Definition at line 227 of file error.h.
References m_last_error_stack.
|
inline |
Definition at line 203 of file error.h.
References m_last_warning_id.
|
inline |
Definition at line 190 of file error.h.
References m_last_warning_message.
Referenced by octave::base_parser::finish_array_list(), and octave::base_parser::make_colon_expression().
|
inline |
Definition at line 153 of file error.h.
References m_quiet_warning.
|
inline |
Definition at line 140 of file error.h.
References m_verbose_warning.
void octave::error_system::set_warning_option | ( | const std::string & | state, |
const std::string & | id | ||
) |
Definition at line 769 of file error.cc.
References octave_map::assign(), octave_map::clear(), octave_map::contents(), default_warning_state(), error(), Array< T >::numel(), Array< T >::resize(), octave::state, and warning_options().
Referenced by disable_warning(), and Fwarning().
|
inline |
Definition at line 166 of file error.h.
References m_warning_options.
void octave::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 870 of file error.cc.
References octave::tree_evaluator::backtrace_info(), octave::interpreter::get_evaluator(), m_interpreter, and message().
Referenced by error_1(), Ferror(), rethrow_error(), and vusage().
void octave::error_system::throw_error | ( | execution_exception & | e | ) |
|
inline |
Definition at line 144 of file error.h.
References m_verbose_warning.
octave_value octave::error_system::verbose_warning | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 321 of file error.cc.
References m_verbose_warning, and set_internal_variable().
Referenced by Fwarning().
|
inline |
Definition at line 142 of file error.h.
References m_verbose_warning.
void octave::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 octave::error_system::vpanic | ( | const char * | fmt, |
va_list | args | ||
) |
Definition at line 635 of file error.cc.
References format_message().
void octave::error_system::vusage | ( | const char * | id, |
const char * | fmt, | ||
va_list | args | ||
) |
Definition at line 511 of file error.cc.
References format_message(), message(), and throw_error().
Referenced by vusage_with_id().
void octave::error_system::vwarning | ( | const char * | id, |
const char * | fmt, | ||
va_list | args | ||
) |
Definition at line 602 of file error.cc.
References error_1(), vwarning(), and warning_enabled().
void octave::error_system::vwarning | ( | const char * | name, |
const char * | id, | ||
const char * | fmt, | ||
va_list | args | ||
) |
Definition at line 519 of file error.cc.
References octave::tree_evaluator::backtrace_message(), backtrace_on_warning(), octave::bp_table::debug_on_warn(), debug_on_warning(), discard_warning_messages(), octave::tree_evaluator::enter_debugger(), octave::flush_stdout(), octave::application::forced_interactive(), format_message(), octave::tree_evaluator::get_bp_table(), octave::interpreter::get_evaluator(), octave::tree_evaluator::in_user_code(), octave::interpreter::interactive(), last_warning_id(), last_warning_message(), m_debug_on_warning, m_interpreter, name, octave_diary, octave::action_container::protect_var(), quiet_warning(), and strlen().
Referenced by vwarning(), and vwarning().
int octave::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 439 of file error.cc.
References check_state(), octave_map::contents(), octave_map::numel(), retval, octave::state, octave_value::string_value(), and warning_options().
Referenced by vwarning(), and warning_enabled().
|
inline |
Definition at line 168 of file error.h.
References m_warning_options.
|
inline |
Definition at line 164 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 octave::error_system::warning_query | ( | const std::string & | id_arg | ) |
Definition at line 653 of file error.cc.
References Array< T >::assign(), octave_map::contents(), last_warning_id(), Array< T >::numel(), retval, octave::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 344 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 340 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 327 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 322 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 332 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 336 of file error.h.
Referenced by discard_warning_messages(), and set_discard_warning_messages().
|
private |
Definition at line 316 of file error.h.
Referenced by throw_error(), and vwarning().
|
private |
The last error message id.
Definition at line 367 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 358 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 370 of file error.h.
Referenced by last_error_stack(), and set_last_error_stack().
|
private |
The last warning message id.
Definition at line 364 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 361 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 352 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 348 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 355 of file error.h.
Referenced by set_warning_options(), and warning_options().