Handle case where promise error is an object #2239