Refactoring.
Added onError function to GameContext.