Skip to content

Commit 0b8047f

Browse files
authored
Libgit2 has a new error class to represent HTTP errors. Add it to the… (#529)
* Libgit2 has a new error class to represent HTTP errors. Add it to the appropriate enums. * Updated Error::class and Error::raw_class to return the Http enum variant.
1 parent e4ebe77 commit 0b8047f

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

libgit2-sys/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ git_enum! {
230230
GIT_ERROR_PATCH,
231231
GIT_ERROR_WORKTREE,
232232
GIT_ERROR_SHA1,
233+
GIT_ERROR_HTTP,
233234
}
234235
}
235236

src/error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ impl Error {
156156
raw::GIT_ERROR_PATCH => super::ErrorClass::Patch,
157157
raw::GIT_ERROR_WORKTREE => super::ErrorClass::Worktree,
158158
raw::GIT_ERROR_SHA1 => super::ErrorClass::Sha1,
159+
raw::GIT_ERROR_HTTP => super::ErrorClass::Http,
159160
_ => super::ErrorClass::None,
160161
}
161162
}
@@ -243,6 +244,7 @@ impl Error {
243244
GIT_ERROR_PATCH,
244245
GIT_ERROR_WORKTREE,
245246
GIT_ERROR_SHA1,
247+
GIT_ERROR_HTTP,
246248
)
247249
}
248250

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ pub enum ErrorClass {
261261
Worktree,
262262
/// Hash library error or SHA-1 collision
263263
Sha1,
264+
/// HTTP error
265+
Http,
264266
}
265267

266268
/// A listing of the possible states that a repository can be in.

0 commit comments

Comments
 (0)