I'm debugging a contract function with Truffle. It always throws the following error:
Error: VM Exception while processing transaction: revert
However, I'm certain that the function has reached the last line, since on the last line I'm emitting an event and Truffle reports that the event has been emitted.
How is it possible that the function reaches the last line which is evident by the fact that the event was successfully emitted, and yet I'm still getting the error above?