// in global
HOnError("*",hErrAll,GerenciarMsgErros)
//----------------------------------------------------------------------------------------------------------
When Exception in
Hdelete(Tabela,hRecNumCurrent,hCheckIntegrity)
Do
ProcedureControlErrors()
end
//----------------------------------------------------------------------------------------------------------
PROCÉDURE GerenciarMsgErros()
SWITCH HError(hErrCurrent)
CASE 70100 // Lock Error
Error("Registro bloqueado por outro usuario","aguarde desbloqueio")
RESULT opEndProcess
CASE 70015 // Integrity Error
Error("Erro de integridade: "+HErrorInfo(hErrFile)+"."+HErrorInfo(hErrItem))
Open(WIN_Integridade)
RESULT opEndProcess
CASE 70010 // Duplicate Error
Error("Duplicidade: "+HErrorInfo(hErrFile)+"."+HErrorInfo(hErrItem),...
"Valor do item: "+{HErrorInfo(hErrFile)+"."+HErrorInfo(hErrItem),indItem})
Open(WIN_Duplicidade)
RESULT opEndProcess
CASE 70022 // Password Error
Error("Erro senha do BD: "+HErrorInfo(hErrFile))
RESULT opEndProcess
CASE 70700 // Modification Conflict
Error("Existe atualização recente neste registro, registro não poderá ser atualizado "+H.FileName)
RESULT opEndProcess
CASE 70710 // Mandatory Value
Error("Campo não preenchido: "+HErrorInfo())
RESULT opEndProcess
CASE 70720 // Maintenance Error
Error("Manutenção do BD em progresso","tente depois!")
RESULT opEndProcess
OTHER CASE
Error("Erro durante o procedimento: "+HErrorInfo())
RESULT opEndProcess
END