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

#include "error.h"

Public Member Functions

 error_system (interpreter &interp)
 
 ~error_system ()=default
 
bool backtrace_on_warning () const
 
bool backtrace_on_warning (bool flag)
 
octave_value backtrace_on_warning (const octave_value_list &args, int nargout)
 
bool beep_on_error () const
 
bool beep_on_error (bool flag)
 
octave_value beep_on_error (const octave_value_list &args, int nargout)
 
bool debug_on_caught () const
 
bool debug_on_caught (bool flag)
 
octave_value debug_on_caught (const octave_value_list &args, int nargout)
 
bool debug_on_error () const
 
bool debug_on_error (bool flag)
 
octave_value debug_on_error (const octave_value_list &args, int nargout)
 
bool debug_on_warning () const
 
bool debug_on_warning (bool flag)
 
octave_value debug_on_warning (const octave_value_list &args, int nargout)
 
std::string default_warning_state ()
 
void disable_warning (const std::string &id)
 
bool discard_warning_messages () const
 
bool discard_warning_messages (bool flag)
 
octave_value discard_warning_messages (const octave_value_list &args, int nargout)
 
void display_exception (const execution_exception &ee) 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 &ee, const char *id, const char *fmt, va_list args)
 
void initialize_default_warning_state ()
 
void interpreter_try (unwind_protect &frame)
 
std::string last_error_id () const
 
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_message () const
 
octave_value last_error_message (const octave_value_list &args, int nargout)
 
std::string last_error_message (const std::string &s)
 
octave_map last_error_stack () const
 
octave_map last_error_stack (const octave_map &new_val)
 
std::string last_warning_id () 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_message () const
 
octave_value last_warning_message (const octave_value_list &args, int nargout)
 
std::string last_warning_message (const std::string &s)
 
OCTAVE_NORETURN void panic (const char *fmt,...)
 
bool quiet_warning () const
 
bool quiet_warning (bool flag)
 
octave_value quiet_warning (const octave_value_list &args, int nargout)
 
OCTAVE_NORETURN void rethrow_error (const std::string &id, const std::string &msg, const octave_map &stack)
 
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)
 
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 &ee)
 
bool verbose_warning () const
 
bool verbose_warning (bool flag)
 
octave_value verbose_warning (const octave_value_list &args, int nargout)
 
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 warning_options (const octave_map &new_val)
 
octave_scalar_map warning_query (const std::string &id_arg)
 

Static Public Member Functions

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

Detailed Description

Definition at line 45 of file error.h.

Constructor & Destructor Documentation

◆ error_system()

error_system::error_system ( interpreter interp)

Definition at line 257 of file error.cc.

◆ ~error_system()

error_system::~error_system ( )
default

Member Function Documentation

◆ backtrace_on_warning() [1/3]

bool error_system::backtrace_on_warning ( ) const
inline

Definition at line 136 of file error.h.

◆ backtrace_on_warning() [2/3]

bool error_system::backtrace_on_warning ( bool  flag)
inline

Definition at line 138 of file error.h.

◆ backtrace_on_warning() [3/3]

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

Definition at line 314 of file error.cc.

References octave::set_internal_variable().

◆ beep_on_error() [1/3]

bool error_system::beep_on_error ( ) const
inline

Definition at line 122 of file error.h.

◆ beep_on_error() [2/3]

bool error_system::beep_on_error ( bool  flag)
inline

Definition at line 124 of file error.h.

◆ beep_on_error() [3/3]

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

Definition at line 307 of file error.cc.

References octave::set_internal_variable().

◆ debug_on_caught() [1/3]

bool error_system::debug_on_caught ( ) const
inline

Definition at line 74 of file error.h.

◆ debug_on_caught() [2/3]

bool error_system::debug_on_caught ( bool  flag)
inline

Definition at line 76 of file error.h.

◆ debug_on_caught() [3/3]

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

◆ debug_on_error() [1/3]

bool error_system::debug_on_error ( ) const
inline

Definition at line 60 of file error.h.

◆ debug_on_error() [2/3]

bool error_system::debug_on_error ( bool  flag)
inline

Definition at line 62 of file error.h.

◆ debug_on_error() [3/3]

◆ debug_on_warning() [1/3]

bool error_system::debug_on_warning ( ) const
inline

Definition at line 88 of file error.h.

◆ debug_on_warning() [2/3]

bool error_system::debug_on_warning ( bool  flag)
inline

Definition at line 90 of file error.h.

◆ debug_on_warning() [3/3]

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

◆ default_warning_state()

std::string error_system::default_warning_state ( )

Definition at line 711 of file error.cc.

References octave_map::contents(), and warning_options().

◆ disable_warning()

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

Definition at line 841 of file error.cc.

References set_warning_option().

◆ discard_warning_messages() [1/3]

bool error_system::discard_warning_messages ( ) const
inline

Definition at line 105 of file error.h.

◆ discard_warning_messages() [2/3]

bool error_system::discard_warning_messages ( bool  flag)
inline

Definition at line 110 of file error.h.

◆ discard_warning_messages() [3/3]

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

◆ display_exception()

◆ display_warning_options()

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

Definition at line 735 of file error.cc.

References octave_map::contents(), and warning_options().

◆ error_1() [1/2]

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

Definition at line 578 of file error.cc.

References message().

◆ error_1() [2/2]

void error_system::error_1 ( execution_exception ee,
const char *  id,
const char *  fmt,
va_list  args 
)

Definition at line 568 of file error.cc.

Referenced by vwarning().

◆ initialize_default_warning_state()

void error_system::initialize_default_warning_state ( )

Definition at line 847 of file error.cc.

References warning_options().

◆ interpreter_try()

void error_system::interpreter_try ( unwind_protect frame)

Definition at line 868 of file error.cc.

References action_container::protect_var().

◆ last_error_id() [1/3]

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

Definition at line 236 of file error.h.

Referenced by save_exception().

◆ last_error_id() [2/3]

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

◆ last_error_id() [3/3]

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

Definition at line 238 of file error.h.

◆ last_error_message() [1/3]

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

Definition at line 191 of file error.h.

Referenced by save_exception().

◆ last_error_message() [2/3]

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

Definition at line 336 of file error.cc.

References octave::set_internal_variable().

Referenced by tree_evaluator::visit_try_catch_command().

◆ last_error_message() [3/3]

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

Definition at line 193 of file error.h.

◆ last_error_stack() [1/2]

octave_map error_system::last_error_stack ( ) const
inline

Definition at line 250 of file error.h.

Referenced by save_exception(), and tree_evaluator::visit_try_catch_command().

◆ last_error_stack() [2/2]

octave_map error_system::last_error_stack ( const octave_map new_val)
inline

Definition at line 252 of file error.h.

◆ last_warning_id() [1/3]

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

Definition at line 222 of file error.h.

Referenced by warning_query().

◆ last_warning_id() [2/3]

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

Definition at line 351 of file error.cc.

References octave::set_internal_variable().

◆ last_warning_id() [3/3]

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

Definition at line 224 of file error.h.

◆ last_warning_message() [1/3]

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

Definition at line 206 of file error.h.

◆ last_warning_message() [2/3]

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

◆ last_warning_message() [3/3]

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

Definition at line 209 of file error.h.

◆ 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.

Referenced by save_exception().

◆ panic()

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

Definition at line 645 of file error.cc.

References vpanic().

◆ quiet_warning() [1/3]

bool error_system::quiet_warning ( ) const
inline

Definition at line 164 of file error.h.

◆ quiet_warning() [2/3]

bool error_system::quiet_warning ( bool  flag)
inline

Definition at line 166 of file error.h.

◆ quiet_warning() [3/3]

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

Definition at line 329 of file error.cc.

References octave::set_internal_variable().

◆ 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 134 of file error.h.

◆ set_beep_on_error()

void error_system::set_beep_on_error ( bool  flag)
inline

Definition at line 120 of file error.h.

◆ set_debug_on_caught()

void error_system::set_debug_on_caught ( bool  flag)
inline

Definition at line 72 of file error.h.

◆ set_debug_on_error()

void error_system::set_debug_on_error ( bool  flag)
inline

Definition at line 58 of file error.h.

Referenced by tree_evaluator::enter_debugger().

◆ set_debug_on_warning()

void error_system::set_debug_on_warning ( bool  flag)
inline

Definition at line 86 of file error.h.

Referenced by tree_evaluator::enter_debugger().

◆ set_discard_warning_messages()

void error_system::set_discard_warning_messages ( bool  flag)
inline

Definition at line 100 of file error.h.

Referenced by base_parser::finish_array_list(), and base_parser::make_colon_expression().

◆ set_last_error_id()

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

Definition at line 234 of file error.h.

◆ set_last_error_message()

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

Definition at line 188 of file error.h.

◆ set_last_error_stack()

void error_system::set_last_error_stack ( const octave_map val)
inline

Definition at line 245 of file error.h.

◆ set_last_warning_id()

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

Definition at line 219 of file error.h.

◆ set_last_warning_message()

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

Definition at line 203 of file error.h.

Referenced by base_parser::finish_array_list(), and base_parser::make_colon_expression().

◆ set_quiet_warning()

void error_system::set_quiet_warning ( bool  flag)
inline

Definition at line 162 of file error.h.

◆ set_verbose_warning()

void error_system::set_verbose_warning ( bool  flag)
inline

Definition at line 148 of file error.h.

◆ set_warning_option()

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

Definition at line 776 of file error.cc.

Referenced by disable_warning().

◆ set_warning_options()

void error_system::set_warning_options ( const octave_map val)
inline

Definition at line 175 of file error.h.

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

Definition at line 881 of file error.cc.

References tree_evaluator::backtrace_info(), interpreter::get_evaluator(), and message().

Referenced by rethrow_error().

◆ throw_error() [2/2]

void error_system::throw_error ( execution_exception ee)

Definition at line 906 of file error.cc.

◆ verbose_warning() [1/3]

bool error_system::verbose_warning ( ) const
inline

Definition at line 150 of file error.h.

◆ verbose_warning() [2/3]

bool error_system::verbose_warning ( bool  flag)
inline

Definition at line 152 of file error.h.

◆ verbose_warning() [3/3]

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

Definition at line 322 of file error.cc.

References octave::set_internal_variable().

◆ verror()

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 634 of file error.cc.

Referenced by panic().

◆ vusage()

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

Definition at line 497 of file error.cc.

References message().

◆ vwarning() [1/2]

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

Definition at line 589 of file error.cc.

References error_1(), vwarning(), and warning_enabled().

◆ vwarning() [2/2]

void error_system::vwarning ( const char *  name,
const char *  id,
const char *  fmt,
va_list  args 
)

Definition at line 506 of file error.cc.

References flush_stdout().

Referenced by vwarning().

◆ 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 424 of file error.cc.

References octave_map::contents(), octave_map::numel(), and warning_options().

Referenced by vwarning().

◆ warning_options() [1/2]

octave_map error_system::warning_options ( ) const
inline

◆ warning_options() [2/2]

octave_map error_system::warning_options ( const octave_map new_val)
inline

Definition at line 178 of file error.h.

◆ warning_query()

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

Definition at line 654 of file error.cc.

References octave_map::contents(), last_warning_id(), and warning_options().


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