eis/mix_cc/exception/get_nested_exception.h

34 lines
983 B
C
Raw Normal View History

/**
* @file mix_cc/exception/get_nested_exception.h
* @brief expection格式化
* @author Cat (null.null.null@qq.com)
* @version 0.1
* @date 2021-05-07
*
* Copyright: Baosight Co. Ltd.
* DO NOT COPY/USE WITHOUT PERMISSION
*
*/
#pragma once
#include <mix_cc/json.h>
#include <exception>
#include <string>
namespace mix_cc {
/**
* @brief mix_cc异常
* @param e mix_cc异常
* @param level
* @return std::string
*/
std::string get_nested_exception(const std::exception& e, int level = 0);
/**
* @brief mix_cc异常,json形式返回
* @param e mix_cc异常
* @param level
* @return json
*/
json get_nested_exception_json(const std::exception& e, int level = 0);
} // namespace mix_cc