forked from substrait-io/substrait-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExceptions.cpp
More file actions
31 lines (25 loc) · 824 Bytes
/
Exceptions.cpp
File metadata and controls
31 lines (25 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* SPDX-License-Identifier: Apache-2.0 */
#include "substrait/common/Exceptions.h"
#include <fmt/core.h>
#include <cstddef>
#include <string>
namespace io::substrait::common {
SubstraitException::SubstraitException(
const char* file,
size_t line,
const char* function,
const std::string& exceptionCode,
const std::string& exceptionMessage,
Type exceptionType,
const std::string& exceptionName)
: msg_(fmt::format(
"Exception: {}\nError Code: {}\nError Type: {}\nReason: {}\n"
"Function: {}\nLocation: {}(Line:{})\n",
exceptionName,
exceptionCode,
exceptionType == Type::kSystem ? "system" : "user",
exceptionMessage,
function,
file,
std::to_string(line))) {}
} // namespace io::substrait::common