You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

error_expression.go 588 B

123456789101112131415161718192021
  1. package expr
  2. // ErrorExpression is a placeholder implementation that always reports an error.
  3. // When parsing/constructing an expression fails, this type is returned directly.
  4. // The Value() method returns the error as-is, and SetValue() is a no-op.
  5. type ErrorExpression struct {
  6. err error
  7. expressionStr string
  8. }
  9. func (e *ErrorExpression) Value(elContext any) any {
  10. return e.err
  11. }
  12. func (e *ErrorExpression) SetValue(value any, elContext any) {
  13. // No write operation for error expressions
  14. }
  15. func (e *ErrorExpression) ExpressionString() string {
  16. return e.expressionStr
  17. }