Log errors instead of calling trigger_error()

I truly hate these `trigger_error`s. I think they serve no purpose other than confusing newbies and myself.

Either we use Exception, or just return boolean (which we already do) so that caller know the result.