You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to ask how you think I should handle operations that only really make sense matching either everything in the list or just something?
For context, let's consider the DoesNotContain operation and a set of values x and y.
Passing a list will, by default, Match.All - this translates to Name DoesNotContain x AND DoesNotContain y - which makes perfect sense.
However, if we were to Match.Any - which translates to Name DoesNotContain x OR DoesNotContain y - every result will match; this is because, if it contains x, it will be returned by the y condition; if it contains y, it will be returned by the x condition
When there is this obvious issue, of returning every result, do I continue to allow it or throw a new type of exception (possibly EveryResultException)?
Allow it or throw it?
Continue to allow it
0%
Throw an exception (I'm happy with calling it `EveryResultException`)
100%
Throw an exception (BOOO, rubbish name, call it something else)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to ask how you think I should handle operations that only really make sense matching either everything in the list or just something?
For context, let's consider the
DoesNotContain
operation and a set of valuesx
andy
.Passing a list will, by default,
Match.All
- this translates toName DoesNotContain x AND DoesNotContain y
- which makes perfect sense.However, if we were to
Match.Any
- which translates toName DoesNotContain x OR DoesNotContain y
- every result will match; this is because, if it containsx
, it will be returned by they
condition; if it containsy
, it will be returned by thex
conditionWhen there is this obvious issue, of returning every result, do I continue to allow it or throw a new type of exception (possibly
EveryResultException
)?1 vote ·
Beta Was this translation helpful? Give feedback.
All reactions