Building on top of PR to include the error code into output as well