github.com/gogf/gf/v2@v2.7.4/errors/gerror/gerror.go (about)

     1  // Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/gogf/gf.
     6  
     7  // Package gerror provides rich functionalities to manipulate errors.
     8  //
     9  // For maintainers, please very note that,
    10  // this package is quite a basic package, which SHOULD NOT import extra packages
    11  // except standard packages and internal packages, to avoid cycle imports.
    12  package gerror
    13  
    14  import (
    15  	"github.com/gogf/gf/v2/errors/gcode"
    16  )
    17  
    18  // IEqual is the interface for Equal feature.
    19  type IEqual interface {
    20  	Error() string
    21  	Equal(target error) bool
    22  }
    23  
    24  // ICode is the interface for Code feature.
    25  type ICode interface {
    26  	Error() string
    27  	Code() gcode.Code
    28  }
    29  
    30  // IStack is the interface for Stack feature.
    31  type IStack interface {
    32  	Error() string
    33  	Stack() string
    34  }
    35  
    36  // ICause is the interface for Cause feature.
    37  type ICause interface {
    38  	Error() string
    39  	Cause() error
    40  }
    41  
    42  // ICurrent is the interface for Current feature.
    43  type ICurrent interface {
    44  	Error() string
    45  	Current() error
    46  }
    47  
    48  // IUnwrap is the interface for Unwrap feature.
    49  type IUnwrap interface {
    50  	Error() string
    51  	Unwrap() error
    52  }
    53  
    54  const (
    55  	// commaSeparatorSpace is the comma separator with space.
    56  	commaSeparatorSpace = ", "
    57  )