Improve serialization error handling.
This commit is contained in:
parent
1fd63b8783
commit
5ed7cf2b1c
8 changed files with 81 additions and 39 deletions
|
|
@ -1,5 +1,7 @@
|
|||
package sqlbuilder
|
||||
|
||||
import "errors"
|
||||
|
||||
type numericExpression interface {
|
||||
expression
|
||||
|
||||
|
|
@ -130,9 +132,12 @@ func newNumericExpressionWrap(expression expression) numericExpression {
|
|||
return &numericExpressionWrap
|
||||
}
|
||||
|
||||
func (c *numericExpressionWrapper) serialize(statement statementType, out *queryData) error {
|
||||
func (n *numericExpressionWrapper) serialize(statement statementType, out *queryData) error {
|
||||
if n == nil {
|
||||
return errors.New("Numeric expression wrapper is nil. ")
|
||||
}
|
||||
//out.writeString("(")
|
||||
err := c.expression.serialize(statement, out)
|
||||
err := n.expression.serialize(statement, out)
|
||||
//out.writeString(")")
|
||||
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue