1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-17 23:35:47 +00:00

[api] Consolidate fatal error logging to reduce flash usage (#11015)

This commit is contained in:
J. Nick Koston
2025-10-05 08:56:30 -05:00
committed by GitHub
parent 6c7d92e726
commit 7b48fc292f
2 changed files with 11 additions and 18 deletions

View File

@@ -732,8 +732,11 @@ class APIConnection final : public APIServerConnection {
// Helper function to log API errors with errno
void log_warning_(const LogString *message, APIError err);
// Specific helper for duplicated error message
void log_socket_operation_failed_(APIError err);
// Helper to handle fatal errors with logging
inline void fatal_error_with_log_(const LogString *message, APIError err) {
this->on_fatal_error();
this->log_warning_(message, err);
}
};
} // namespace esphome::api