2 Commits
Author SHA1 Message Date
Juan Carlos Aguilera Mendez 5428e5e4ea Merged PR 1720111: Move error to the correct file
### 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?

### ChangeLog (Refer [Template](../oss/CHANGELOG.md))

### Description

Move Location13103 error to documentdb_codes.txt

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix: Moving an error code definition to the correct file.

#### PR Summary
This pull request corrects the placement of the "Location13103" error by removing it from one file and adding it into the proper location.
- `pg_documentdb_gw/include/gateway_errors.txt`: Removed the "Location13103" error entry.
- `pg_documentdb_core/include/utils/documentdb_codes.txt`: Added the "Location13103" error entry.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-07-09 18:56:11 +08:00
Juan Carlos Aguilera Mendez 02bfca5839 Merged PR 1713127: Provide the correct codeName on error and codegen for error codes and mapping
### 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?

### ChangeLog (Refer [Template](../oss/CHANGELOG.md))

### Description

Added code generation to create all error codes off of shared csv definition files as well as the means to map an i64 to an error code. Also, if we have a known error code, fetch the proper error string, if exists, or None

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix to correctly convert error codes to text strings.

#### PR Summary
This pull request fixes the misassignment of error code and message, ensuring that error codes are properly converted to their text representation.
- `src/responses/error.rs`: Reordered parameters in the `CommandError::new` call to swap the error code and message.
- `src/responses/pg.rs`: Updated error handling to use `ErrorCode::from_i64` for converting error codes to text and added a dependency on `num_traits::FromPrimitive`.
- `src/error.rs`: Added the `IndexNotFound` error variant with corresponding mapping in the `FromPrimitive` implementation.
- `tests/test_search_tests.rs`: Introduced a test to validate that a text query fails with the expected "text index required for $text query" error message.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

Related work items: #4293767
2025-07-09 18:56:11 +08:00