Created
November 18, 2022 13:41
-
-
Save viniciussanchez/3178515d7254059813aa4d860e77c514 to your computer and use it in GitHub Desktop.
Classe para controlar as exceções em Delphi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unit Handler.Exception; | |
interface | |
uses System.SysUtils; | |
type | |
TMyHandlerException = class | |
private | |
class procedure GerarLog(E: Exception); | |
class procedure EnviarEmail(E: Exception); | |
public | |
class procedure DoHandlerException(Sender: TObject; E: Exception); | |
end; | |
implementation | |
uses Vcl.Dialogs, System.UITypes; | |
class procedure TMyHandlerException.DoHandlerException(Sender: TObject; E: Exception); | |
begin | |
GerarLog(E); | |
EnviarEmail(E); | |
MessageDlg('Aconteceu um erro, mas não se preocupe, já avisamos a equipe do suporte!', mtError, [mbOK], 0); | |
end; | |
class procedure TMyHandlerException.EnviarEmail(E: Exception); | |
begin | |
end; | |
class procedure TMyHandlerException.GerarLog(E: Exception); | |
begin | |
end; | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment