github.com/Finschia/finschia-sdk@v0.48.1/types/errors/handle.go (about)

     1  package errors
     2  
     3  import "fmt"
     4  
     5  // AssertNil panics on error
     6  // Should be only used with interface methods, which require return error, but the
     7  // error is always nil
     8  func AssertNil(err error) {
     9  	if err != nil {
    10  		panic(fmt.Errorf("logic error - this should never happen. %w", err))
    11  	}
    12  }