✅ Good:
raise UserNotFoundError(details="User not found")
raise NotificationNotFoundError(details="Notification not found")❌ Avoid:
raise DataNotFoundError(details="User not found") # Too generic✅ Good:
raise UserAuthenticationError(
details="Invalid credentials. Please check your email/password."
)Before:
return Response({'detail': 'Error'}, status=404)After:
raise UserNotFoundError(details="User not found")- Users :
UserNotFoundError,UserAuthenticationError - Products :
ProductNotFoundError,ProductOutOfStockError - Orders :
OrderNotFoundError,OrderValidationError - Categories :
CategoryNotFoundError - Notifications :
NotificationNotFoundError,NotificationServiceError - Payments :
PaymentError,InsufficientFundsError