Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

APItools/bugsnag-lua

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bugsnag-lua Build Status

A small Lua interface to Bugsnag that supports the HTTP notification interface and also has a helpful wrapper function call() that takes any arbitrary Lua function (with arguments) and executes it, traps any errors and reports it automatically to Bugsnag.

Synopsis

    local bugsnag = require "bugsnag"

    local bug = bugsnag:new("api-key")

    -- Send a message to sentry
    local ok, err = bug:captureMessage(
      "Sentry is a realtime event logging and aggregation platform.",
      { tags = { abc = "def" } } -- optional
    )
    if not ok then
       print(err)
    end

    -- Send an exception to sentry
    local exception = {{
       ["errorClass"]= "SyntaxError",
       ["value"]= "Wattttt!",
       ["module"]= "__builtins__"
    }}
    local ok, err = bug:captureException(
       exception,
       { tags = { abc = "def" } } -- optional
    )
    if not ok then
       print(err)
    end

    -- Catch an exception and send it to sentry
    function bad_func(n)
       return not_defined_func(n)
    end

    -- variable 'ok' should be false, and an exception will be sent to sentry
    local ok = bug:call(bad_func, 1)

Documents

See docs/index.html for more details.

Prerequisites

    #for unit tests
    $luarocks install lunit
    $luarocks install luaposix

    #for generating docs
    $luarocks install ldoc

Releases

No releases published

Packages

No packages published

Languages

  • Lua 75.0%
  • CSS 23.5%
  • Makefile 1.5%