move promise error handler