Professional Documents
Culture Documents
GJ1-2.1.3 Error Handling-290624-070210
GJ1-2.1.3 Error Handling-290624-070210
GJ1-2.1.3 Error Handling-290624-070210
3 Error Handling
Exception Handling:
Policy: Use try-catch blocks for handling recoverable errors. Log exceptions for debugging and analysis.
Specific vs. Generic Exceptions: Catch specific exceptions where possible to provide more detailed error handling.
Assertions:
Usage: Use assertions to validate assumptions within the code. Assertions should be used for conditions that should never occur
during normal execution.
Handling Failures: Handle assertion failures by logging errors and potentially halting execution in development environments.
Null Checks:
Flags: Use a simple boolean null check when running code relying on another object or class not present inside the current class.