This kind of error generally occurs when you are branching out your code (using if-else or switch case) and then returning values from some of the conditions but not all.
This is the compiler error CS0101 and you can read more about it
here[
^]. They have a sample that should explain the error to you as well.