JANA2
C++ framework for multi-threaded data processing
JException Struct Reference

JException is a data object which attaches JANA-specific context information to a generic exception. More...

#include <JException.h>

Inheritance diagram for JException:
[legend]
Collaboration diagram for JException:
[legend]

Public Member Functions

 JException (std::string message="Unknown exception")
 Basic constructor.
 
template<typename... Args>
 JException (std::string message, Args... args)
 Constructor with printf-style formatting. More...
 
std::string GetMessage ()
 
std::string GetStackTrace ()
 
const char * what () const noexcept
 

Public Attributes

std::string exception_type
 
std::string message
 
std::string plugin_name
 
std::string type_name
 
std::string function_name
 
std::string instance_name
 
std::string stacktrace
 
std::exception_ptr nested_exception
 
bool show_stacktrace =true
 

Friends

std::ostream & operator<< (std::ostream &os, JException const &ex)
 Convenience method for formatting complete error data.
 

Detailed Description

JException is a data object which attaches JANA-specific context information to a generic exception.

As it unwinds the call stack, different exception handlers may add or change information as they see fit. It does not use getters and setters, because they are not needed, because there is no invariant.

Constructor & Destructor Documentation

◆ JException()

template<typename... Args>
JException::JException ( std::string  format_str,
Args...  args 
)
explicit

Constructor with printf-style formatting.

Constructor with convenient printf-style formatting.

Uses variadic templates (although it is slightly overkill) because variadic functions are frowned on now.


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