This is just
This is just, as it has been said before, hard-coding and handling a few specific cases. In a nutshell, it's frustrating, even more because the error handling is not verbose enough.
Furthermore, this really does not encourage Tes Driven Development as : 1) the tests are written once and not during the coding process 2) the developer doesn't know what exactly fails
So it ends up being just a good ol' code'n'pray, lookig at a few console prints and trying to understand what, oh god what fails on a very frustrating exercise...
TL;DR
why so frustrating ?