[SERVER-50639] Improve function "const T* mongo::Status::extraInfo()" to support errors with optional extraInfo Created: 31/Aug/20  Updated: 28/Apr/21  Resolved: 26/Apr/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Mindaugas Malinauskas Assignee: Denis Grebennicov
Resolution: Duplicate Votes: 0
Labels: neweng, qexec-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-52741 Avoid invariant when trying to get op... Closed
Related
related to SERVER-56348 Adjust call sites of the optional "st... Closed
Sprint: Query Execution 2021-05-03
Participants:

 Description   

Improve template function "const T* mongo::Status::extraInfo()" to support errors with optional extra info by changing its contract to return nullptr when status is not OK, the error type matches parameter T, the error permits optional extra info and extra info is not present. Currently, the behaviour of the function for the given conditions is to trip an assertion.

This change would simplify caller's access to extraInfo when dealing with errors with optional extra info. Currently, to retrieve the extraInfo it is necessary to check the error code of the status and if the extraInfo exists.


Generated at Thu Feb 08 05:23:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.