errhtml

package module
v0.0.0-...-f0989ed Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2016 License: MIT Imports: 9 Imported by: 0

README

errhtml Build Status Coverage Status GoDoc

This Go package can render runtime errors/panics to HTML. Useful during development.

Examples

panic template error

Install

go get github.com/stephanos/errhtml

Documentation

godoc.org

Credits

Most of the code/template from the Revel framework.

License

MIT (see LICENSE).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewError

func NewError(err interface{}, sources ...Source) error

NewError creates an error that can be rendered to HTML. It receives an error, from a panic or not, and an optional error source.

func Render

func Render(err interface{}, w io.Writer)

Render creates an error context from the passed-in error and renders it to the passed-in writer.

Types

type Source

type Source struct {
	// contains filtered or unexported fields
}

Source represents the origin of an error.

func NewFileSource

func NewFileSource(filePath string, line int) Source

NewFileSource creates a new error source from a file path and line.

func NewTextSource

func NewTextSource(text string) Source

NewTextSource creates a new error source from a text.

Jump to

Keyboard shortcuts

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