All Projects → emperror → Emperror

emperror / Emperror

Licence: mit
The Emperor takes care of all errors personally

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Emperror

Bugsnag Node
[DEPRECATED] Please upgrade to our Universal JS notifier "@bugsnag/js" • https://github.com/bugsnag/bugsnag-js
Stars: ✭ 48 (-76.12%)
Mutual labels:  error-handling, error-monitoring, error-reporting, error-handler, error
Bugsnag Go
Automatic panic monitoring for Go and Go web frameworks, like negroni, gin, and revel
Stars: ✭ 155 (-22.89%)
Mutual labels:  error-handling, error-monitoring, error-reporting, error
TrackJS-Node
TrackJS Error Monitoring agent for NodeJS
Stars: ✭ 26 (-87.06%)
Mutual labels:  error-monitoring, error-handling, error, error-reporting
Bugsnag Php
Bugsnag error monitoring and crash reporting tool for PHP apps
Stars: ✭ 475 (+136.32%)
Mutual labels:  error-handling, error-monitoring, error-reporting
bugsnag-wordpress
Bugsnag error monitoring for WordPress sites
Stars: ✭ 20 (-90.05%)
Mutual labels:  error-monitoring, error-handling, error-reporting
Bugsnag React Native
Error monitoring and reporting tool for native exceptions and JS errors in React Native apps
Stars: ✭ 374 (+86.07%)
Mutual labels:  error-handling, error-monitoring, error-reporting
raygun4py
Python provider for Raygun
Stars: ✭ 18 (-91.04%)
Mutual labels:  error-monitoring, error-handling, error-reporting
Make Error Cause
Make your own nested errors
Stars: ✭ 36 (-82.09%)
Mutual labels:  error-handling, error-reporting, error
Bugsnag Js
Javascript error handling tool for Bugsnag. Monitor and report JavaScript bugs & errors.
Stars: ✭ 625 (+210.95%)
Mutual labels:  error-handling, error-monitoring, error-reporting
Raygun4net
Raygun provider for .NET
Stars: ✭ 107 (-46.77%)
Mutual labels:  error-handling, error-monitoring, error-reporting
Bugsnag Android Ndk
DEPRECATED - this project now lives at bugsnag/bugsnag-android
Stars: ✭ 42 (-79.1%)
Mutual labels:  error-handling, error-monitoring, error-reporting
Exceptionless
Exceptionless server and jobs
Stars: ✭ 2,107 (+948.26%)
Mutual labels:  error-handling, error-monitoring, error-reporting
raygun4ruby
The Ruby & Ruby on Rails provider for Raygun
Stars: ✭ 37 (-81.59%)
Mutual labels:  error-monitoring, error-handling, error-reporting
sentry-testkit
A Sentry plugin to allow Sentry report interception and further inspection of the data being sent
Stars: ✭ 78 (-61.19%)
Mutual labels:  error-monitoring, error-handling, error-reporting
Log Process Errors
Show some ❤️ to Node.js process errors
Stars: ✭ 424 (+110.95%)
Mutual labels:  error-handling, error-handler, error
react-error-guard
⚛️An overlay for displaying stack frames based on create-react-app/packages/react-error-overlay
Stars: ✭ 18 (-91.04%)
Mutual labels:  error-monitoring, error-handling, error-reporting
Bugsnag Laravel
Bugsnag notifier for the Laravel PHP framework. Monitor and report Laravel errors.
Stars: ✭ 746 (+271.14%)
Mutual labels:  error-handling, error-monitoring, error-reporting
ouch
⚓ Cool errors for PHP nerds ⚓
Stars: ✭ 23 (-88.56%)
Mutual labels:  error-monitoring, error-handler, error-reporting
raygun4android
Android crash reporting provider for Raygun
Stars: ✭ 19 (-90.55%)
Mutual labels:  error-monitoring, error-handling, error-reporting
Rollbar Android
Rollbar for Android
Stars: ✭ 41 (-79.6%)
Mutual labels:  error-handling, error-monitoring, error-handler

Emperror

Mentioned in Awesome Go

GitHub Workflow Status Codecov Go Report Card Go Version PkgGoDev FOSSA Status

The Emperor takes care of all errors personally.

Go's philosophy encourages to gracefully handle errors whenever possible, but some times recovering from an error is not.

In those cases handling the error means making the best effort to record every detail for later inspection, doing that as high in the application stack as possible.

This project provides tools to make error handling easier.

Read more about the topic here:

Features

Installation

go get emperror.dev/emperror

Usage

Log errors

Logging is one of the most common target to record error events.

Emperror has two logger integrations by default:

Annotate errors passing through an error handler

Emperror can annotate errors with details as defined in emperror.dev/errors

package main

import (
	"emperror.dev/emperror"
	"emperror.dev/errors"
)

func main() {
	handler := emperror.WithDetails(newHandler(), "key", "value")

	err := errors.New("error")

	// handled error will receive the handler details
	handler.Handle(err)
}

Panics and recovers

package main

import (
	"emperror.dev/emperror"
	"emperror.dev/errors"
)

func main() {
	var handler emperror.Handler = newHandler()

	// Recover from panics and handle them as errors
	defer emperror.HandleRecover(handler)

	// nil errors will not panic
	emperror.Panic(nil)

	// this will panic if foo returns with a non-nil error
	// useful in main func for initial setup where "if err != nil" does not make much sense
	emperror.Panic(foo())
}

func foo() error {
	return errors.New("error")
}

Filter errors

Sometimes you might not want to handle certain errors that reach the error handler. A common example is a catch-all error handler in a server. You want to return business errors to the client.

package main

import (
	"emperror.dev/emperror"
	"emperror.dev/errors/match"
)

func main() {
	var handler emperror.Handler = emperror.WithFilter(newHandler(), match.Any{/*any emperror.ErrorMatcher*/})

    // errors matching the provided matcher will not be handled
	handler.Handle(err)
}

Development

Contributions are welcome! :)

  1. Clone the repository
  2. Make changes on a new branch
  3. Run the test suite:
    ./pleasew build
    ./pleasew test
    ./pleasew gotest
    ./pleasew lint
    
  4. Commit, push and open a PR

License

The MIT License (MIT). Please see License File for more information.

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].