Index

resty-gitweb / master

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

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
1605 Mar 2021 17:0234b90b0Fix production errorsJosh Stockin111G

Blob @ resty-gitweb / git / git2_error.lua

text/plain515 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("<pre>libgit2 Error - %s (\"%s\")\n%s</pre>", message, git2_error_message, debug.traceback()))
14 end
15end
16
17return _M
18