What is the reason of dumping it and why not to write it into log instead?
It seems to me all 'default' cases here and below should generate exception/error since invalid input is not good for DB integrity.