go-agent: github.com/sqreen/go-agent/sdk/types Index | Files

package types

import "github.com/sqreen/go-agent/sdk/types"


Package Files


type SqreenError Uses

type SqreenError struct {
    Err error

SqreenError is the wrapper error type returned by every Sqreen protection. It allows to implement specific error management logic when Sqreen has blocked a function call by returning a non-nil Go error. For example, if a SQL injection was detected and blocked by Sqreen, it is possible to avoid retrying the SQL query when the error is a `SqreenError`. To do so, use `errors.As`:

if errors.As(err, &types.SqreenError{}) {
    // Sqreen error logic
    log.Println("sqreen error detected")
} else if err != nil {
    // Non-Sqreen error logic

func (SqreenError) Error Uses

func (e SqreenError) Error() string

func (SqreenError) Unwrap Uses

func (e SqreenError) Unwrap() error

Package types imports 1 packages (graph) and is imported by 2 packages. Updated 2020-06-19. Refresh now. Tools for package owners.