All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.delphi.rules.community-delphi.SwallowedException.html Maven / Gradle / Ivy

There is a newer version: 1.12.1
Show newest version

Why is this an issue?

Exception handlers should contain logic to handle the caught exception. Empty exception handlers indicate that an exception is being ignored instead of correctly handled.

How to fix it

If the exception should be handled at a higher level, remove the exception handler:

try
  RaiseException;
except
  // Do nothing
end;
RaiseException;

If the exception should be handled at this level, add some logic to handle it:

try
  RaiseException;
except
  // Do nothing
end;
try
  RaiseException;
except
  Log('Oh no, exception raised :(');
end;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy