summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeah (ctucx) <leah@ctu.cx>2021-03-17 18:24:55 +0100
committerLeah (ctucx) <leah@ctu.cx>2021-03-17 18:24:55 +0100
commitc563d6b781509730e3f1a34e9135d79043555b77 (patch)
tree416b0917b288ab3f43460483f5bd04de6887568c
parenta38083061ec162bba4e56b38b0041af843ed5f1c (diff)
downloadnimgit-c563d6b781509730e3f1a34e9135d79043555b77.tar.gz
nimgit-c563d6b781509730e3f1a34e9135d79043555b77.tar.bz2
nimgit-c563d6b781509730e3f1a34e9135d79043555b77.zip
utils.nim: new proc getLastError
-rw-r--r--nimgit/utils.nim7
1 files changed, 6 insertions, 1 deletions
diff --git a/nimgit/utils.nim b/nimgit/utils.nim
index 0b4c2c1..df42159 100644
--- a/nimgit/utils.nim
+++ b/nimgit/utils.nim
@@ -2,7 +2,12 @@ import times
import nimgit2
import types
+proc getLastError* (): GitErrorObj =
+ let error = git_error_last()
+
+ result.message = $error.message
+ result.class = error.klass.getErrorClass
+
proc parseGitTime* (time: git_time): GitTime =
result.time = fromUnix(time.time)
result.offset = time.offset
- result.isSigned = (time.sign == '+') \ No newline at end of file