MakeParseError returns a parse error using the provided string and type. An optional error can be provided, which will be appended to the end of the error string.
(s string, typ *types.T, err error)
| 279 | // optional error can be provided, which will be appended to the end of the |
| 280 | // error string. |
| 281 | func MakeParseError(s string, typ *types.T, err error) error { |
| 282 | if err != nil { |
| 283 | return pgerror.Wrapf(err, pgcode.InvalidTextRepresentation, |
| 284 | "could not parse %q as type %s", s, typ) |
| 285 | } |
| 286 | return pgerror.Newf(pgcode.InvalidTextRepresentation, |
| 287 | "could not parse %q as type %s", s, typ) |
| 288 | } |
| 289 | |
| 290 | func makeUnsupportedComparisonMessage(d1, d2 Datum) error { |
| 291 | return pgerror.Newf(pgcode.DatatypeMismatch, |
no test coverage detected
searching dependent graphs…