Index

resty-gitweb / c69d6c0

A git web interface for Lua/OpenResty (you're on it right now!)

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
703 Jan 2021 10:11609d330libgit2 binding updates, README updatesJosh Stockin1170G

Blob @ resty-gitweb / git / git2_error.lua

text/plain481 bytesdownload raw
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
8local ffi = require("ffi")
9
10local _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
15end
16
17return _M
18