FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
git2cpp/src/utils/git_exception.cpp at main · QuantStack/git2cpp · GitHub
QuantStack
git2cpp
Repository navigation
Code
Issues
6
(6)
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
git2cpp
/
src
/
utils
/
git_exception.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
32 lines (26 loc) · 661 Bytes
Breadcrumbs
git2cpp
/
src
/
utils
/
git_exception.cpp
Copy path
File metadata and controls
32 lines (26 loc) · 661 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
32
#
include
"
git_exception.hpp
"
#
include
<
git2.h
>
void
throw_if_error
(
int
exit_code)
{
if
(exit_code <
0
)
{
throw
git_exception
(
"
error:
"
+
std::string
(
git_error_last
()->
message
), exit_code);
}
}
git_exception::git_exception
(
const
std::string_view message,
int
error_code)
: m_message(message)
, m_error_code(error_code)
{
}
git_exception::git_exception
(
const
std::string_view message, git2cpp_error_code error_code)
: git_exception(message,
static_cast
<
int
>(error_code))
{
}
int
git_exception::error_code
()
const
{
return
m_error_code;
}
const
char
*
git_exception::what
()
const
noexcept
{
return
m_message.
c_str
();
}
Back
|
FazBrowse Home
|
New Git URL