Make HiS-Nord transmitter a bit more verbose when it returns a failure in log

This commit is contained in:
Daniel Schick 2024-11-07 14:35:39 +01:00
parent 14931ce2c3
commit b552bf2dd0

View File

@ -75,6 +75,26 @@ namespace bsmd.hisnord
_log.Warn($"Killing Transmitter {processId} failed: {e.Message}");
}
}
else
{
int exitCode = transmitterProcess.ExitCode;
if (exitCode != 0)
{
string errorText = "";
switch(exitCode)
{
case 1: errorText = "Schema violation"; break;
case 2:
case 3: errorText = "Element must not be null"; break;
case 1000: errorText = "Internal error"; break;
case 1001: errorText = "Access denied - Login"; break;
case 1004: errorText = "Access denied - Internal Configuration"; break;
case 1005: errorText = "Internal configuration error"; break;
case 2000: errorText = "File not found"; break;
}
_log.ErrorFormat("Transmitter returned code {0}: {1}", exitCode, errorText);
}
}
}
return true;
}