Skip to content

A Simple Yet Highly Powerful Package For Error Handling

License

Notifications You must be signed in to change notification settings

ThundR67/falcon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Report Card GoDoc GoCover

Falcon

Minimal And Efficient Error Handling In Go

Simple Example

errHandler := falcon.NewErrorHandler()

errHandler.AddHandler(func(err error, data ...interface{}) interface{} {
    fmt.Println("Generic Error Occured")
    return SomeData
})

errHandler.AddHandler(func(err error, data ...interface{}) interface{} {
    fmt.Println("Error Of Type CustomErrorType Occured")
    return SomeData
}, CustomErrorType{})

SomeData := errHandler.Check(err, SomeRandomData1, SomeRandomData2)
// Data passed after the err will be passed to handlers

About

A Simple Yet Highly Powerful Package For Error Handling

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages