please unify how to deal with error. You call `printLog` above, but use `console.log` here.

And if the error handler is same, please make a function instead impl in each place.