CCBTS02 - Memcached Service

Why does using ‘break’ statement after encountering an ‘error’ state in the problem give a wrong answer?

https://www.codechef.com/viewsolution/56273071

Please give the link to your submission.

Here is the link to my solution - Solution: 56273071 | CodeChef