-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Internal Client
-
Fully Compatible
-
Sharding EMEA 2021-10-18, Sharding EMEA 2021-11-01
DBDirectClient inherits from DBClientBase and as a result it picks up several write methods, which do not return any errors nor results and the caller is supposed to use getLastError afterwards in order to know what happened. Specifically these are: insert/update/delete and most likely create/dropIndexes.
This is very error prone, because user of this class can accidentally not check, expecting an exception to be thrown on error, but instead they get nothing and the method silently fails.
As part of this ticket, these methods should be removed and instead a more modern replacement should be introduced, which invokes commands under the hood and throws proper errors, similar to here.