Files
dify-plugin-daemon/pkg/entities/error.go
2025-11-17 15:58:50 +08:00

22 lines
438 B
Go

package entities
import "github.com/langgenius/dify-plugin-daemon/pkg/utils/parser"
type Error struct {
ErrorType string `json:"error_type"`
Message string `json:"message"`
Args any `json:"args"`
}
func (e *Error) Error() string {
return parser.MarshalJson(e)
}
func NewError(error_type string, message string, args ...any) *Error {
return &Error{
ErrorType: error_type,
Message: message,
Args: args,
}
}