mirror of
https://github.com/langgenius/dify-plugin-daemon.git
synced 2026-07-23 10:15:22 -04:00
22 lines
443 B
Go
22 lines
443 B
Go
package entities
|
|
|
|
import "github.com/langgenius/dify-plugin-daemon/internal/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,
|
|
}
|
|
}
|