What's the preferred way to handle the following case:
switch (numberOfActualBytes)
{
case 1: return something1;
case 2: return something2;
case 3: return something3;
case 4: return something4;
}
I know for certain that numberOfActualBytes
due to the used contract is in range 1-4
.
How should I write the code that doesn't result in not all code paths return a value
error?
I suspect I should throw some exception at the end of this function or in default switch case
, but probably there is a better solution.