mirror of
https://github.com/akuker/RASCSI.git
synced 2025-04-06 22:37:17 +00:00
Updated error handling
This commit is contained in:
parent
c5b7f2ffd4
commit
5e20391ebd
@ -18,6 +18,7 @@
|
||||
#include "gpiobus.h"
|
||||
#include "devices/scsi_host_bridge.h"
|
||||
#include "devices/scsi_daynaport.h"
|
||||
#include "exceptions.h"
|
||||
#include <sstream>
|
||||
|
||||
//===========================================================================
|
||||
@ -368,7 +369,14 @@ void SASIDEV::Command()
|
||||
ctrl.blocks = 0;
|
||||
|
||||
// Execution Phase
|
||||
Execute();
|
||||
try {
|
||||
Execute();
|
||||
}
|
||||
catch (const lun_exception& e) {
|
||||
LOGINFO("%s Invalid LUN %d for ID %d", __PRETTY_FUNCTION__, e.getlun(), GetSCSIID());
|
||||
|
||||
Error(ERROR_CODES::sense_key::ILLEGAL_REQUEST, ERROR_CODES::asc::INVALID_LUN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -241,16 +241,17 @@ void SCSIDEV::Execute()
|
||||
ctrl.blocks = 1;
|
||||
ctrl.execstart = SysTimer::GetTimerLow();
|
||||
|
||||
ctrl.device = ctrl.unit[GetLun()];
|
||||
|
||||
try {
|
||||
ctrl.device->Dispatch(this);
|
||||
ctrl.device = ctrl.unit[GetLun()];
|
||||
}
|
||||
catch (const lun_exception& e) {
|
||||
LOGINFO("%s Invalid LUN %d", __PRETTY_FUNCTION__, e.getlun());
|
||||
|
||||
Error(ERROR_CODES::sense_key::ILLEGAL_REQUEST, ERROR_CODES::asc::INVALID_LUN);
|
||||
return;
|
||||
}
|
||||
|
||||
ctrl.device->Dispatch(this);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user