A git web interface for Lua/OpenResty (you're on it right now!)
{#} | Time | Hash | Subject | Author | # | (+) | (-) | GPG? |
---|---|---|---|---|---|---|---|---|
7 | 03 Jan 2021 10:11 | 609d330 | libgit2 binding updates, README updates | Josh Stockin | 1 | 17 | 0 | G |
1 | -- resty-gitweb@git/git2_error.lua |
2 | -- Error handling for libgit2 |
3 | |
4 | -- Copyright (c) 2020 Joshua 'joshuas3' Stockin |
5 | -- <https://git.joshstock.in/resty-gitweb> |
6 | -- This software is licensed under the MIT License. |
7 | |
8 | local ffi = require("ffi") |
9 | |
10 | local _M = function(err, message) |
11 | if err < 0 then |
12 | local git2_error_message = ffi.string(git2.git_error_last().message) |
13 | error(string.format([[libgit2 Error - %s ("%s")]], message, git2_error_message)) |
14 | end |
15 | end |
16 | |
17 | return _M |
18 |