github.com/wangyougui/gf/v2@v2.6.5/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/wangyougui/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/wangyougui/gf/v2/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 )