Tag

Exception Handling

1 views collected around this technical thread.

Java Captain
Java Captain
Jun 8, 2025 · Backend Development

How to Refactor Bloated Spring Controllers into Clean, Maintainable Code

The article critiques overly large and tangled Spring MVC controllers, demonstrates ugly examples filled with try‑catch blocks, field validations, and business logic, then presents streamlined, elegant alternatives using @Valid, @Autowired, proper exception handling, and best‑practice guidelines to dramatically reduce code size and improve readability.

Controller RefactoringException HandlingJava
0 likes · 10 min read
How to Refactor Bloated Spring Controllers into Clean, Maintainable Code
macrozheng
macrozheng
Jun 6, 2025 · Backend Development

Master 10 Essential Spring Boot Extension Points for Robust Backend Development

This guide walks through ten crucial Spring Boot extension points—including global exception handling, custom interceptors, container access, configuration imports, startup runners, bean definition tweaks, initialization hooks, bean post‑processing, graceful shutdown, and custom scopes—providing clear explanations and ready‑to‑use code samples for building resilient backend services.

Custom ScopeException HandlingInterceptor
0 likes · 15 min read
Master 10 Essential Spring Boot Extension Points for Robust Backend Development
macrozheng
macrozheng
Jun 5, 2025 · Backend Development

How to Refactor Spring Boot Controllers for Cleaner, More Maintainable Code

This article compares messy and elegant Spring Boot controller implementations, demonstrates how to use @Valid for input validation, introduces a concise global exception handler, and provides practical refactoring steps and open‑source resources to dramatically reduce controller code size and improve maintainability.

@ValidControllerException Handling
0 likes · 10 min read
How to Refactor Spring Boot Controllers for Cleaner, More Maintainable Code
Test Development Learning Exchange
Test Development Learning Exchange
Jun 4, 2025 · Fundamentals

Understanding Python Exception Handling: Syntax, Usage, and Best Practices

This article explains Python's exception handling mechanisms, covering try, except, else, and finally blocks, detailed usage examples, raising custom exceptions, and best practice recommendations for writing robust and maintainable code in software.

Exception HandlingPythonbest practices
0 likes · 7 min read
Understanding Python Exception Handling: Syntax, Usage, and Best Practices
Top Architect
Top Architect
Jun 3, 2025 · Backend Development

Best Practices for Spring MVC Controller Design: Unified Response, Validation, and Exception Handling

This article explains how to design Spring MVC controllers with a unified response structure, implement request validation using JSR‑303 and custom annotations, handle exceptions uniformly, and resolve issues with ResponseBodyAdvice and HttpMessageConverters to improve code clarity and maintainability.

ControllerException HandlingJava
0 likes · 18 min read
Best Practices for Spring MVC Controller Design: Unified Response, Validation, and Exception Handling
Architect
Architect
May 27, 2025 · Backend Development

Improving Spring MVC Controller Layer: Unified Response, Validation, and Exception Handling

This article explains how to refactor a Spring MVC Controller layer by separating responsibilities, implementing a unified response structure, handling String response conversion, customizing validation with JSR‑303, and creating centralized exception handling to produce consistent API results.

ControllerException HandlingJava
0 likes · 20 min read
Improving Spring MVC Controller Layer: Unified Response, Validation, and Exception Handling
php中文网 Courses
php中文网 Courses
May 23, 2025 · Backend Development

Optimizing Exception Handling in PHP: Best Practices and Code Examples

This article explains how to improve PHP exception handling by using try‑catch blocks, custom exception classes, multiple catch clauses, finally blocks, and additional functions like throw and set_exception_handler, providing clear code samples for each technique.

Error ManagementException HandlingPHP
0 likes · 5 min read
Optimizing Exception Handling in PHP: Best Practices and Code Examples
Top Architecture Tech Stack
Top Architecture Tech Stack
May 11, 2025 · Backend Development

Using Java 8 Functional Interfaces to Replace Repetitive if‑else Logic

This article explains how Java 8 functional interfaces such as Function, Supplier, Consumer, and Runnable can replace repetitive if‑else statements, provides code examples for throwing exceptions, branch handling, and present‑or‑else logic, and demonstrates practical usage to improve backend code readability.

ConsumerException HandlingFunctional Interface
0 likes · 6 min read
Using Java 8 Functional Interfaces to Replace Repetitive if‑else Logic
macrozheng
macrozheng
May 9, 2025 · Backend Development

Master Spring Boot Parameter Validation: From Bean Validation to Global Exception Handling

This tutorial walks through the need for robust API parameter validation in Spring Boot, introduces the Bean Validation specification and its implementations, explains key constraint annotations, demonstrates a quick start with Maven dependencies, shows how to build DTOs and controllers, and details a unified global exception handling strategy for clean error responses.

API ValidationBean ValidationException Handling
0 likes · 22 min read
Master Spring Boot Parameter Validation: From Bean Validation to Global Exception Handling
Code Mala Tang
Code Mala Tang
May 8, 2025 · Backend Development

Mastering Exception Handling in FastAPI: Strategies, Patterns, and Code

Learn how to design robust exception handling for FastAPI applications by combining Look‑Before‑You‑Leap and EAFP strategies, creating custom exception classes, organizing handlers, and integrating them into your API to improve maintainability, clarity, and error response consistency.

Custom ExceptionsError ManagementException Handling
0 likes · 19 min read
Mastering Exception Handling in FastAPI: Strategies, Patterns, and Code
php中文网 Courses
php中文网 Courses
May 7, 2025 · Backend Development

Best Practices for Exception Handling in PHP

This article provides a comprehensive guide to PHP exception handling, covering the distinction between exceptions and errors, basic try‑catch syntax, advanced strategies such as custom exception types, chaining, global handlers, common pitfalls, logging, monitoring, performance impacts, and security best practices.

Error ManagementException HandlingPHP
0 likes · 8 min read
Best Practices for Exception Handling in PHP
Code Mala Tang
Code Mala Tang
May 5, 2025 · Information Security

6 Essential Python Security Practices Every Developer Should Follow

Learn how to safeguard your Python applications by avoiding hard‑coded secrets, using .env files, employing virtual environments, validating and sanitizing inputs, handling files securely, encrypting sensitive data, and implementing proper exception handling—all essential steps for robust information security.

EncryptionEnvironment VariablesException Handling
0 likes · 5 min read
6 Essential Python Security Practices Every Developer Should Follow
Java Captain
Java Captain
Apr 30, 2025 · Backend Development

Refactoring Controller Layer Logic: Unified Response Structure, Parameter Validation, and Global Exception Handling in Spring

This article outlines a four‑step approach to refactor Spring MVC controllers by unifying response structures, centralizing response wrapping via ResponseBodyAdvice, implementing robust parameter validation with JSR‑303, and handling custom exceptions globally, resulting in cleaner, more maintainable backend code.

ControllerException HandlingParameter Validation
0 likes · 18 min read
Refactoring Controller Layer Logic: Unified Response Structure, Parameter Validation, and Global Exception Handling in Spring
Cognitive Technology Team
Cognitive Technology Team
Apr 29, 2025 · Backend Development

Common CompletableFuture Pitfalls and Best Practices in Java

This article examines the powerful Java CompletableFuture class, identifies frequent misuse pitfalls such as ignored exceptions, wrong thread‑pool choices, blocking callbacks, context loss, and overly fragmented chains, and provides concrete avoidance strategies and best‑practice recommendations for robust asynchronous programming.

CompletableFutureException HandlingJava
0 likes · 9 min read
Common CompletableFuture Pitfalls and Best Practices in Java
Zhuanzhuan Tech
Zhuanzhuan Tech
Apr 28, 2025 · Backend Development

Design and Evolution of ZhiZhi Checkout Payment Routing System

This article presents an in‑depth analysis of the ZhiZhi checkout payment routing system, covering its historical evolution from basic configuration to rule‑engine and modular construction modes, detailing architecture, expression engine implementation, automatic anomaly detection, and future outlook for scalability and AI integration.

Exception Handlingbackend architectureexpression-engine
0 likes · 28 min read
Design and Evolution of ZhiZhi Checkout Payment Routing System
Top Architecture Tech Stack
Top Architecture Tech Stack
Apr 21, 2025 · Backend Development

Effect of Placing try‑catch Inside vs Outside a for Loop in Java

This article explains how positioning a try‑catch block either outside or inside a Java for‑loop influences exception handling, loop termination, performance, and memory consumption, providing code examples, execution results, and practical recommendations for backend developers.

Exception HandlingJavabackend
0 likes · 6 min read
Effect of Placing try‑catch Inside vs Outside a for Loop in Java
php中文网 Courses
php中文网 Courses
Apr 14, 2025 · Fundamentals

Creating and Using Custom Exceptions in Python

This article explains why custom exceptions are needed in Python, shows how to define them—including simple, information‑rich, and subclassed variants—provides practical code examples such as inventory‑shortage and API‑request errors, and outlines best practices for naming, documentation, and inheritance.

Custom ExceptionsError DesignException Handling
0 likes · 6 min read
Creating and Using Custom Exceptions in Python
Java Captain
Java Captain
Apr 14, 2025 · Backend Development

Project Initialization, Version Management, and Scaffold Setup for Spring Boot Backend Development

This guide walks through initializing a Spring Boot project, handling IDE setup challenges, managing version compatibility between Spring Cloud, Spring Boot, and Kafka, and provides practical code examples for global exception handling, logging, CORS configuration, Swagger integration, and useful development tools.

Exception HandlingKafkaMaven
0 likes · 12 min read
Project Initialization, Version Management, and Scaffold Setup for Spring Boot Backend Development
php中文网 Courses
php中文网 Courses
Apr 11, 2025 · Fundamentals

Handling Exceptions When Processing CSV and JSON Files in Python

This article explains how to use Python's try‑except and with statements to safely read and process CSV and JSON files, covering common errors such as missing files, permission issues, format problems, and providing best‑practice examples for robust error handling.

CSVException HandlingJSON
0 likes · 7 min read
Handling Exceptions When Processing CSV and JSON Files in Python
JD Tech Talk
JD Tech Talk
Apr 10, 2025 · Backend Development

Proper RPC Interface Design: Avoiding Result Wrappers and Using Exceptions

The article explains why designing RPC interfaces with generic Result objects that contain errorCode, errorMessage and data defeats RPC's purpose, and demonstrates how returning plain business objects and leveraging Java exceptions leads to cleaner, more maintainable backend code.

Exception HandlingInterface DesignJava
0 likes · 8 min read
Proper RPC Interface Design: Avoiding Result Wrappers and Using Exceptions