improved error logging for promises