Fawkes API  Fawkes Development Version
pddl_parser::PddlParserException Class Reference

Exception thrown by the parser if an error occurs during parsing. More...

#include <>>

Inheritance diagram for pddl_parser::PddlParserException:

Public Member Functions

 PddlParserException (const char *msg)
 Constructor. More...
 
void collapse_msg ()
 Merge all error messages to a single one. More...
 
const char * what () const override throw ()
 Get primary string. More...
 
 PddlParserException (const std::string &msg)
 Constructor with a string message. More...
 
- Public Member Functions inherited from fawkes::Exception
 Exception (const char *format,...) noexcept
 Constructor. More...
 
 Exception (int errnoval, const char *format,...) noexcept
 Constructor. More...
 
 Exception (const Exception &exc) noexcept
 Copy constructor. More...
 
virtual ~Exception () noexcept
 Destructor. More...
 
virtual void raise ()
 This can be used to throw this exception. More...
 
void prepend (const char *format,...) noexcept
 Prepend messages to the message list. More...
 
void append (const char *format,...) noexcept
 Append messages to the message list. More...
 
void append_va (const char *format, va_list va) noexcept
 Append messages to the message list. More...
 
void append (const Exception &e) noexcept
 Append message that are from another Exception. More...
 
void print_trace () noexcept
 Prints trace to stderr. More...
 
void print_backtrace () const noexcept
 Prints a backtrace. More...
 
char * generate_backtrace () const noexcept
 Generate backtrace string. More...
 
int get_errno () noexcept
 Get errno. More...
 
void set_type_id (const char *id)
 Set exception type ID. More...
 
const char * type_id () const
 Get type ID. More...
 
virtual const char * what_no_backtrace () const noexcept
 Get primary string (does not implicitly print the back trace). More...
 
Exceptionoperator= (const Exception &exc) noexcept
 Assign an Exception. More...
 
iterator begin () noexcept
 Get iterator for messages. More...
 
iterator end () noexcept
 Get end iterator for messages. More...
 

Additional Inherited Members

- Protected Member Functions inherited from fawkes::Exception
 Exception () noexcept
 Constructor for subclasses. More...
 
void append_nolock (const char *format,...) noexcept
 Append messages without lock. More...
 
void append_nolock_va (const char *format, va_list va) noexcept
 Append messages without lock by formatted string. More...
 
void append_nolock_nocopy (char *msg) noexcept
 Append message without copying. More...
 
void prepend_nolock_va (const char *format, va_list va) noexcept
 Prepend messages without lock by formatted string. More...
 
void copy_messages (const Exception &exc) noexcept
 Copy messages from given exception. More...
 
- Protected Attributes inherited from fawkes::Exception
message_list_tmessages
 List of messages. More...
 
message_list_tmessages_iterator
 Iterator to iterate over messages. More...
 
message_list_tmessages_end
 Pointer that points to the very last message. More...
 
Mutexmessages_mutex
 Mutex to protect operations on messages list. More...
 
int _errno
 Error number, should be used if the error was caused by a method that supplies errno. More...
 

Detailed Description

Exception thrown by the parser if an error occurs during parsing.

Definition at line 37 of file pddl_exception.h.

Constructor & Destructor Documentation

◆ PddlParserException() [1/2]

pddl_parser::PddlParserException::PddlParserException ( const char *  msg)
inline

Constructor.

Parameters
msgA message describing the error.

Definition at line 43 of file pddl_exception.h.

◆ PddlParserException() [2/2]

pddl_parser::PddlParserException::PddlParserException ( const std::string &  msg)
inline

Constructor with a string message.

This wraps the constructor with a char* message for usage with std::string.

Parameters
msgA message describing the error.

Definition at line 87 of file pddl_exception.h.

Member Function Documentation

◆ collapse_msg()

void pddl_parser::PddlParserException::collapse_msg ( )
inline

◆ what()

const char* pddl_parser::PddlParserException::what ( ) const
throw (
)
inlineoverridevirtual

Get primary string.

Messages are stored in a list. The first entry in this list is called primary message. This is why it is important to have a meaningful first message!

Returns
Returns a constant char pointer with the message. The message is private to the exception and may not be modified or freed (hence const) If no message has been set "Unknown error" is returned. This method may be overidden by other exceptions. This method is also called by the runtime system if the exception was not caught and resulted in a program termination.
string describing the general cause of the current error

Reimplemented from fawkes::Exception.

Definition at line 75 of file pddl_exception.h.

References fawkes::Exception::messages, and fawkes::Exception::message_list_t::msg.


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