merge -c1618 branches/1.4-foe: Improved FoE.

This commit is contained in:
Florian Pose
2009-01-26 13:09:27 +00:00
parent 7a703ecb05
commit 8d45915fc4
11 changed files with 167 additions and 65 deletions
+14 -1
View File
@@ -9,6 +9,7 @@
using namespace std;
#include "CommandFoeRead.h"
#include "foe.h"
/*****************************************************************************/
@@ -82,7 +83,19 @@ void CommandFoeRead::execute(MasterDevice &m, const StringVector &args)
m.readFoe(&data);
} catch (MasterDeviceException &e) {
delete [] data.buffer;
throw e;
if (data.result) {
if (data.result == FOE_OPCODE_ERROR) {
err << "FoE read aborted with error code 0x"
<< setw(8) << setfill('0') << hex << data.error_code
<< ": " << errorText(data.error_code);
} else {
err << "Failed to write via FoE: "
<< resultText(data.result);
}
throwCommandException(err);
} else {
throw e;
}
}
// TODO --output-file