Jump to content

Recommended Posts

Posted
How to Disable Javascript Error in browsers?

 


To centralize errors in an application use the VCL component ApplicationEvents, example:

 


 

procedure TFrmPrincipal.ApplicationEvents1Exception(Sender: TObject;

  E: Exception);

var

  Mensagem: string;

  Pos1, Pos2: integer;

begin

  if Pos(UpperCase('unavailable database'), UpperCase(E.Message)) <> 0 then

    ShowMessage('Servidor de Banco de Dados Off-Line.')

  else if Pos(UpperCase('is not a valid date'), UpperCase(E.Message)) <> 0 then

    ShowMessage('Data inválida, proceda a correção.')

  else if Pos(UpperCase('key violation'), UpperCase(E.Message)) <> 0 then

    ShowMessage('Houve violação de Chave.  Registro já incluido.')

  else if Pos(UpperCase('Input value'), UpperCase(E.Message)) <> 0 then

    ShowMessage('Campo preenchido com valor não válido. Proceda a correção.')

  else if Pos(UpperCase('is not a valid time'), UpperCase(E.Message)) <> 0 then

    ShowMessage('Hora inválida, proceda a correção.')

  else if Pos(UpperCase('must have a value'), UpperCase(E.Message)) <> 0 then

  begin

    Pos1 := Pos('''', E.Message);

    Mensagem := E.Message;

    Delete(Mensagem, Pos1, 1);

    Pos2 := Pos('''', Mensagem);

    Mensagem := copy(E.Message, Pos1 + 1, Pos2 - Pos1);

    ShowMessage('É obrigatório o preenchimento do campo "' + Mensagem + '".');

  end

  else

    ShowMessage(E.Message);

end;

 

How to implement this in UniGUI? 

 

Error in Opera browser..

post-875-0-32788200-1359557464_thumb.jpg

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...