gitee.com/hongliu9527/go-tools@v0.0.8/errors/gerror/gerror.go (about)

     1  /*
     2   * @Author: hongliu
     3   * @Date: 2022-12-29 10:51:12
     4   * @LastEditors: hongliu
     5   * @LastEditTime: 2022-12-29 11:32:32
     6   * @FilePath: \go-tools\errors\gerror\gerror.go
     7   * @Description:内部错误接口定义
     8   *
     9   * Copyright (c) 2022 by 洪流, All Rights Reserved.
    10   */
    11  
    12  package gerror
    13  
    14  import (
    15  	"gitee.com/hongliu9527/go-tools/errors/gcode"
    16  )
    17  
    18  // IIs is the interface for Is feature.
    19  type IIs interface {
    20  	Error() string
    21  	Is(target error) bool
    22  }
    23  
    24  // IEqual is the interface for Equal feature.
    25  type IEqual interface {
    26  	Error() string
    27  	Equal(target error) bool
    28  }
    29  
    30  // ICode is the interface for Code feature.
    31  type ICode interface {
    32  	Error() string
    33  	Code() gcode.Code
    34  }
    35  
    36  // IStack is the interface for Stack feature.
    37  type IStack interface {
    38  	Error() string
    39  	Stack() string
    40  }
    41  
    42  // ICause is the interface for Cause feature.
    43  type ICause interface {
    44  	Error() string
    45  	Cause() error
    46  }
    47  
    48  // ICurrent is the interface for Current feature.
    49  type ICurrent interface {
    50  	Error() string
    51  	Current() error
    52  }
    53  
    54  // IUnwrap is the interface for Unwrap feature.
    55  type IUnwrap interface {
    56  	Error() string
    57  	Unwrap() error
    58  }
    59  
    60  const (
    61  	// commaSeparatorSpace is the comma separator with space.
    62  	commaSeparatorSpace = ", "
    63  )