error handler by hack ctx.onerror