GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
error_system Class Reference

#include "error.h"

Collaboration diagram for error_system:

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_systemoperator= (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...
 
interpreterm_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...
 

Detailed Description

Definition at line 45 of file error.h.

Constructor & Destructor Documentation

◆ error_system() [1/2]

error_system::error_system ( interpreter interp)

Definition at line 257 of file error.cc.

References initialize_default_warning_state().

◆ error_system() [2/2]

error_system::error_system ( const error_system )
delete

◆ ~error_system()

error_system::~error_system ( void  )
default

Member Function Documentation

◆ backtrace_on_warning() [1/3]

bool error_system::backtrace_on_warning ( bool  flag)
inline

Definition at line 140 of file error.h.

References m_backtrace_on_warning.

◆ backtrace_on_warning() [2/3]

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().

◆ backtrace_on_warning() [3/3]

bool error_system::backtrace_on_warning ( void  ) const
inline

Definition at line 138 of file error.h.

References m_backtrace_on_warning.

Referenced by vwarning().

◆ beep_on_error() [1/3]

bool error_system::beep_on_error ( bool  flag)
inline

Definition at line 126 of file error.h.

References m_beep_on_error.

◆ beep_on_error() [2/3]

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().

◆ beep_on_error() [3/3]

bool error_system::beep_on_error ( void  ) const
inline

Definition at line 124 of file error.h.

References m_beep_on_error.

◆ debug_on_caught() [1/3]

bool error_system::debug_on_caught ( bool  flag)
inline

Definition at line 78 of file error.h.

References m_debug_on_caught.

◆ debug_on_caught() [2/3]

◆ debug_on_caught() [3/3]

bool error_system::debug_on_caught ( void  ) const
inline

Definition at line 76 of file error.h.

References m_debug_on_caught.

◆ debug_on_error() [1/3]

bool error_system::debug_on_error ( bool  flag)
inline

Definition at line 64 of file error.h.

References m_debug_on_error.

◆ debug_on_error() [2/3]

◆ debug_on_error() [3/3]

bool error_system::debug_on_error ( void  ) const
inline

Definition at line 62 of file error.h.

References m_debug_on_error.

◆ debug_on_warning() [1/3]

bool error_system::debug_on_warning ( bool  flag)
inline

Definition at line 92 of file error.h.

References m_debug_on_warning.

◆ debug_on_warning() [2/3]

◆ debug_on_warning() [3/3]

bool error_system::debug_on_warning ( void  ) const
inline

Definition at line 90 of file error.h.

References m_debug_on_warning.

Referenced by vwarning().

◆ default_warning_state()

std::string error_system::default_warning_state ( void  )

◆ disable_warning()

void error_system::disable_warning ( const std::string &  id)

◆ discard_warning_messages() [1/3]

bool error_system::discard_warning_messages ( bool  flag)
inline

Definition at line 112 of file error.h.

References m_discard_warning_messages.

◆ discard_warning_messages() [2/3]

octave_value error_system::discard_warning_messages ( const octave_value_list args,
int  nargout 
)

◆ discard_warning_messages() [3/3]

bool error_system::discard_warning_messages ( void  ) const
inline

Definition at line 107 of file error.h.

References m_discard_warning_messages.

Referenced by vwarning().

◆ display_exception() [1/2]

void error_system::display_exception ( const execution_exception ee) const

◆ display_exception() [2/2]

void error_system::display_exception ( const execution_exception ee,
std::ostream &  os 
) const

◆ display_warning_options()

void error_system::display_warning_options ( std::ostream &  os)

◆ error_1() [1/2]

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().

◆ error_1() [2/2]

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().

◆ initialize_default_warning_state()

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().

◆ interpreter_try()

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().

◆ last_error_id() [1/3]

octave_value error_system::last_error_id ( const octave_value_list args,
int  nargout 
)

◆ last_error_id() [2/3]

std::string error_system::last_error_id ( const std::string &  s)
inline

Definition at line 240 of file error.h.

References m_last_error_id.

◆ last_error_id() [3/3]

std::string error_system::last_error_id ( void  ) const
inline

Definition at line 238 of file error.h.

References m_last_error_id.

Referenced by save_exception().

◆ last_error_message() [1/3]

octave_value error_system::last_error_message ( const octave_value_list args,
int  nargout 
)

◆ last_error_message() [2/3]

std::string error_system::last_error_message ( const std::string &  s)
inline

Definition at line 195 of file error.h.

References m_last_error_message.

◆ last_error_message() [3/3]

std::string error_system::last_error_message ( void  ) const
inline

Definition at line 193 of file error.h.

References m_last_error_message.

Referenced by save_exception().

◆ last_error_stack() [1/2]

octave_map error_system::last_error_stack ( const octave_map new_val)
inline

Definition at line 254 of file error.h.

References m_last_error_stack.

◆ last_error_stack() [2/2]

octave_map error_system::last_error_stack ( void  ) const
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().

◆ last_warning_id() [1/3]

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().

◆ last_warning_id() [2/3]

std::string error_system::last_warning_id ( const std::string &  s)
inline

Definition at line 226 of file error.h.

References m_last_warning_id.

◆ last_warning_id() [3/3]

std::string error_system::last_warning_id ( void  ) const
inline

Definition at line 224 of file error.h.

References m_last_warning_id.

Referenced by vwarning(), and warning_query().

◆ last_warning_message() [1/3]

octave_value error_system::last_warning_message ( const octave_value_list args,
int  nargout 
)

◆ last_warning_message() [2/3]

std::string error_system::last_warning_message ( const std::string &  s)
inline

Definition at line 211 of file error.h.

References m_last_warning_message.

◆ last_warning_message() [3/3]

std::string error_system::last_warning_message ( void  ) const
inline

Definition at line 208 of file error.h.

References m_last_warning_message.

Referenced by vwarning().

◆ make_stack_frame_list()

std::list< frame_info > error_system::make_stack_frame_list ( const octave_map stack)
static

Definition at line 399 of file error.cc.

References octave_map::contents(), and Array< T, Alloc >::numel().

Referenced by Ferror(), and rethrow_error().

◆ make_stack_map()

octave_map error_system::make_stack_map ( const std::list< frame_info > &  frames)
static

Definition at line 372 of file error.cc.

References bt_fields, Cell::column(), and octave_map::contents().

Referenced by save_exception().

◆ operator=()

error_system& error_system::operator= ( const error_system )
delete

◆ panic()

void error_system::panic ( const char *  fmt,
  ... 
)

Definition at line 636 of file error.cc.

References vpanic().

◆ quiet_warning() [1/3]

bool error_system::quiet_warning ( bool  flag)
inline

Definition at line 168 of file error.h.

References m_quiet_warning.

◆ quiet_warning() [2/3]

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().

◆ quiet_warning() [3/3]

bool error_system::quiet_warning ( void  ) const
inline

Definition at line 166 of file error.h.

References m_quiet_warning.

Referenced by vwarning().

◆ rethrow_error()

void error_system::rethrow_error ( const std::string &  id,
const std::string &  msg,
const octave_map stack 
)

◆ save_exception()

◆ set_backtrace_on_warning()

void error_system::set_backtrace_on_warning ( bool  flag)
inline

Definition at line 136 of file error.h.

References m_backtrace_on_warning.

◆ set_beep_on_error()

void error_system::set_beep_on_error ( bool  flag)
inline

Definition at line 122 of file error.h.

References m_beep_on_error.

◆ set_debug_on_caught()

void error_system::set_debug_on_caught ( bool  flag)
inline

Definition at line 74 of file error.h.

References m_debug_on_caught.

◆ set_debug_on_error()

void error_system::set_debug_on_error ( bool  flag)
inline

Definition at line 60 of file error.h.

References m_debug_on_error.

Referenced by tree_evaluator::enter_debugger().

◆ set_debug_on_warning()

void error_system::set_debug_on_warning ( bool  flag)
inline

Definition at line 88 of file error.h.

References m_debug_on_warning.

Referenced by tree_evaluator::enter_debugger().

◆ set_discard_warning_messages()

void error_system::set_discard_warning_messages ( bool  flag)
inline

◆ set_last_error_id()

void error_system::set_last_error_id ( const std::string &  val)
inline

Definition at line 236 of file error.h.

References m_last_error_id.

◆ set_last_error_message()

void error_system::set_last_error_message ( const std::string &  val)
inline

Definition at line 190 of file error.h.

References m_last_error_message.

◆ set_last_error_stack()

void error_system::set_last_error_stack ( const octave_map val)
inline

Definition at line 247 of file error.h.

References m_last_error_stack.

◆ set_last_warning_id()

void error_system::set_last_warning_id ( const std::string &  val)
inline

Definition at line 221 of file error.h.

References m_last_warning_id.

◆ set_last_warning_message()

void error_system::set_last_warning_message ( const std::string &  val)
inline

◆ set_quiet_warning()

void error_system::set_quiet_warning ( bool  flag)
inline

Definition at line 164 of file error.h.

References m_quiet_warning.

◆ set_verbose_warning()

void error_system::set_verbose_warning ( bool  flag)
inline

Definition at line 150 of file error.h.

References m_verbose_warning.

◆ set_warning_option()

void error_system::set_warning_option ( const std::string &  state,
const std::string &  id 
)

◆ set_warning_options()

void error_system::set_warning_options ( const octave_map val)
inline

Definition at line 177 of file error.h.

References m_warning_options.

◆ throw_error() [1/2]

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> () 
)

◆ throw_error() [2/2]

void error_system::throw_error ( execution_exception ee)

Definition at line 888 of file error.cc.

◆ verbose_warning() [1/3]

bool error_system::verbose_warning ( bool  flag)
inline

Definition at line 154 of file error.h.

References m_verbose_warning.

◆ verbose_warning() [2/3]

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().

◆ verbose_warning() [3/3]

bool error_system::verbose_warning ( void  ) const
inline

Definition at line 152 of file error.h.

References m_verbose_warning.

◆ verror()

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 
)

◆ vpanic()

void error_system::vpanic ( const char *  fmt,
va_list  args 
)

Definition at line 626 of file error.cc.

References format_message().

Referenced by panic().

◆ vusage()

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().

◆ vwarning() [1/2]

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().

◆ vwarning() [2/2]

◆ warning_enabled()

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().

◆ warning_options() [1/2]

octave_map error_system::warning_options ( const octave_map new_val)
inline

Definition at line 180 of file error.h.

References m_warning_options.

◆ warning_options() [2/2]

octave_map error_system::warning_options ( void  ) const
inline

◆ warning_query()

octave_scalar_map error_system::warning_query ( const std::string &  id_arg)

Member Data Documentation

◆ m_backtrace_on_warning

bool error_system::m_backtrace_on_warning
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().

◆ m_beep_on_error

bool error_system::m_beep_on_error
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().

◆ m_debug_on_caught

bool error_system::m_debug_on_caught
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().

◆ m_debug_on_error

bool error_system::m_debug_on_error
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().

◆ m_debug_on_warning

bool error_system::m_debug_on_warning
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().

◆ m_discard_warning_messages

bool error_system::m_discard_warning_messages
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().

◆ m_interpreter

interpreter& error_system::m_interpreter
private

Definition at line 348 of file error.h.

Referenced by display_exception(), throw_error(), and vwarning().

◆ m_last_error_id

std::string error_system::m_last_error_id
private

The last error message id.

Definition at line 399 of file error.h.

Referenced by last_error_id(), and set_last_error_id().

◆ m_last_error_message

std::string error_system::m_last_error_message
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().

◆ m_last_error_stack

octave_map error_system::m_last_error_stack
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().

◆ m_last_warning_id

std::string error_system::m_last_warning_id
private

The last warning message id.

Definition at line 396 of file error.h.

Referenced by last_warning_id(), and set_last_warning_id().

◆ m_last_warning_message

std::string error_system::m_last_warning_message
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().

◆ m_quiet_warning

bool error_system::m_quiet_warning
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().

◆ m_verbose_warning

bool error_system::m_verbose_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().

◆ m_warning_options

octave_map error_system::m_warning_options
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().


The documentation for this class was generated from the following files: