File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,22 @@ public static function fromRetryableWrites(stdClass $outcome)
116116 $ o ->isExpected = $ outcome ->error ;
117117 }
118118
119+ /* outcome.result will only contain error label assertions if an error
120+ * is expected (i.e. outcome.error is true). */
121+ if ($ o ->isExpected && isset ($ outcome ->result ->errorLabelsContain )) {
122+ if (! self ::isArrayOfStrings ($ outcome ->result ->errorLabelsContain )) {
123+ throw InvalidArgumentException::invalidType ('errorLabelsContain ' , $ outcome ->result ->errorLabelsContain , 'string[] ' );
124+ }
125+ $ o ->includedLabels = $ outcome ->result ->errorLabelsContain ;
126+ }
127+
128+ if ($ o ->isExpected && isset ($ outcome ->result ->errorLabelsOmit )) {
129+ if (! self ::isArrayOfStrings ($ outcome ->result ->errorLabelsOmit )) {
130+ throw InvalidArgumentException::invalidType ('errorLabelsOmit ' , $ outcome ->result ->errorLabelsOmit , 'string[] ' );
131+ }
132+ $ o ->excludedLabels = $ outcome ->result ->errorLabelsOmit ;
133+ }
134+
119135 return $ o ;
120136 }
121137
You can’t perform that action at this time.
0 commit comments