new version of errorHandler

Please review and merge if good...