refining error handling

* handling type error on max timestamp checking
* raising exception on insert failure that should never be reached under normal conditions