horror

package
v15.11.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2019 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecoverAndLog

func RecoverAndLog(consumer *state.Consumer)

func RecoverInto

func RecoverInto(errp *error)

RecoverInto is a function you can defer-call at the start of a function that you know has a risk of panicking.

Example
package main

import (
	"fmt"

	"github.com/itchio/butler/butlerd/horror"
)

func main() {
	f := func() (retErr error) {
		defer horror.RecoverInto(&retErr)
		panic("Oh no")
	}
	err := f()
	fmt.Printf("Returned from f: %+v", err)
}
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL