Files
documentdb/pg_documentdb
Duan Pei 37b4e7e508 Merged PR 1541101: [Fix Jstest] fix corner case in date_from_string_on_error.js
### Does this PR have any customer impact?

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)

### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)

### Are you introducing any new config? If yes, do you have tests with and without them being set?

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description

 the PR to fix js error of date_from_string_on_error.js

fix case, when onError is provided and dateSring is invalid ,need to throw onError.
example:
dateString is 5, should throw onError.
`db.date_from_string_on_error.aggregate([
    {
        $project: {
            date: {
                $dateFromString: {
                    dateString: 5,
                    format:null,
                    onError: ISODate("2017-07-04T11:56:02Z")
                }
            }
        }
    }]);`

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix

#### PR Summary
This pull request addresses a corner case in the `date_from_string_on_error.js` test by improving error handling in date parsing functions.
- `src/operators/bson_expression_date_operators.c`: Added checks for `isOnErrorProvided` to handle cases where `onError` is specified, ensuring proper error handling and result setting.
- Modified several functions to include the `isOnErrorProvided` parameter to improve error handling logic.
2025-01-15 07:48:41 +00:00
..