You are not logged in.
Pages: 1
I see that all code framework, if the statement is wrong the exception do not explode to user.
In the framework I see this piece of code in several parts:
try
...
GetAndPrepareStatementRelease(...);
...
except
on E: Exception do
GetAndPrepareStatementRelease(E);
end;
So if I assemble an invalid sql statement by mistake when doing the orm.RetrieveDocVariant does not generate an exception bringing up the null record. example:
function TProjetoService.Busca(pId: Int64): TServiceCustomAnswer;
var
vProjeto, vPaineis: Variant;
begin
TDocVariant.New(vProjeto);
vProjeto := GlobalRepository.Orm.RetrieveDocVariant(TProjeto, '(ID=?)', [pId], '');
if VarIsEmptyOrNull(vProjeto) then
Result := ReturnRecordNotFound
else
begin
vPaineis := GlobalRepository.Orm.RetrieveDocVariantArray(TPainel, '',
'(IdProjeto=?)',
[pId],
'ID , Nome2'); <<<<<<<< Nome2 not exists, just Nome field (in runtime this do not generate exception)
vProjeto.Paineis := vPaineis; <<<<< this part run normally bring um Json "Paineis" : null
Result := ReturnOk(vProjeto);
end;
end;
Offline
Also, in TRestStorageExternal methods like EngineList or EngineRetrieve and so on, exceptions are supressed in try..except block, without being stored anywhere.
Offline
Also, in TRestStorageExternal methods like EngineList or EngineRetrieve and so on, exceptions are supressed in try..except block, without being stored anywhere.
do not store in StatementLastException ????????
This is a problem no?
Offline
Pages: 1