From 5e761730f3d3a8d0f6ee1ee06d5087b4e8d0d8e3 Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Wed, 15 Nov 2023 18:02:12 +0100 Subject: [PATCH] Update error handling --- cpp/scsiexec/scsi_executor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/scsiexec/scsi_executor.cpp b/cpp/scsiexec/scsi_executor.cpp index 0f63a68e..9ab4516a 100644 --- a/cpp/scsiexec/scsi_executor.cpp +++ b/cpp/scsiexec/scsi_executor.cpp @@ -30,7 +30,7 @@ bool ScsiExecutor::Execute(const string& filename, bool binary, string& result) if (!binary) { ifstream in(filename); if (in.fail()) { - result = "Can't open JSON input file '" + filename + "'"; + result = "Can't open JSON input file '" + filename + "'" + strerror(errno); return false; } @@ -43,7 +43,7 @@ bool ScsiExecutor::Execute(const string& filename, bool binary, string& result) else { ifstream in(filename, ios::binary); if (in.fail()) { - result = "Can't open binary input file '" + filename + "'"; + result = "Can't open binary input file '" + filename + "': " + strerror(errno); return false; }