onError handling to console