cprover
unwrap_nested_exception.cpp File Reference
#include "unwrap_nested_exception.h"
#include "invariant.h"
#include "string_utils.h"
#include "suffix.h"
#include "throw_with_nested.h"
#include <sstream>
#include <vector>
+ Include dependency graph for unwrap_nested_exception.cpp:

Go to the source code of this file.

Functions

std::string unwrap_exception (const std::exception &e, int level)
 Given a potentially nested exception, produce a string with all of nested exceptions information. More...
 

Function Documentation

◆ unwrap_exception()

std::string unwrap_exception ( const std::exception &  e,
int  level 
)

Given a potentially nested exception, produce a string with all of nested exceptions information.

If a nested exception string contains new lines then the newlines are indented to the correct level.

Parameters
eThe outer exeception
levelHow many exceptions have already been unrolled
Returns
A string with all nested exceptions printed and indented

Definition at line 24 of file unwrap_nested_exception.cpp.