Remove default: switch cases to allow for compiler errors just in case new enum values are introduced
This commit is contained in:
@ -107,10 +107,9 @@ std::string toString(httpd_ws_type_t val)
|
|||||||
case HTTPD_WS_TYPE_CLOSE: return "HTTPD_WS_TYPE_CLOSE"; break;
|
case HTTPD_WS_TYPE_CLOSE: return "HTTPD_WS_TYPE_CLOSE"; break;
|
||||||
case HTTPD_WS_TYPE_PING: return "HTTPD_WS_TYPE_PING"; break;
|
case HTTPD_WS_TYPE_PING: return "HTTPD_WS_TYPE_PING"; break;
|
||||||
case HTTPD_WS_TYPE_PONG: return "HTTPD_WS_TYPE_PONG"; break;
|
case HTTPD_WS_TYPE_PONG: return "HTTPD_WS_TYPE_PONG"; break;
|
||||||
default:
|
|
||||||
ESP_LOGW(TAG, "Unknown httpd_ws_type_t(%i)", std::to_underlying(val));
|
|
||||||
return fmt::format("Unknown httpd_ws_type_t({})", std::to_underlying(val));
|
|
||||||
}
|
}
|
||||||
|
ESP_LOGW(TAG, "Unknown httpd_ws_type_t(%i)", std::to_underlying(val));
|
||||||
|
return fmt::format("Unknown httpd_ws_type_t({})", std::to_underlying(val));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace esphttpdutils
|
} // namespace esphttpdutils
|
||||||
|
@ -67,9 +67,6 @@ const char *toString(ResponseStatus status)
|
|||||||
case ResponseStatus::TooManyRequests: return "429 Too Many Requests";
|
case ResponseStatus::TooManyRequests: return "429 Too Many Requests";
|
||||||
case ResponseStatus::RequestHeaderFieldsTooLarge: return "431 Request Header Fields Too Large";
|
case ResponseStatus::RequestHeaderFieldsTooLarge: return "431 Request Header Fields Too Large";
|
||||||
case ResponseStatus::UnavailableForLegalReasons: return "451 Unavailable For Legal Reasons";
|
case ResponseStatus::UnavailableForLegalReasons: return "451 Unavailable For Legal Reasons";
|
||||||
default:
|
|
||||||
ESP_LOGW(TAG, "unknown httpd_err_code_t(%i)", std::to_underlying(status));
|
|
||||||
[[fallthrough]];
|
|
||||||
case ResponseStatus::InternalServerError: return "500 Internal Server Error";
|
case ResponseStatus::InternalServerError: return "500 Internal Server Error";
|
||||||
case ResponseStatus::NotImplemented: return "501 Not Implemented";
|
case ResponseStatus::NotImplemented: return "501 Not Implemented";
|
||||||
case ResponseStatus::BadGateway: return "502 Bad Gateway";
|
case ResponseStatus::BadGateway: return "502 Bad Gateway";
|
||||||
@ -82,6 +79,9 @@ const char *toString(ResponseStatus status)
|
|||||||
case ResponseStatus::NotExtended: return "510 Not Extended";
|
case ResponseStatus::NotExtended: return "510 Not Extended";
|
||||||
case ResponseStatus::NetworkAuthenticationRequired: return "511 Network Authentication Required";
|
case ResponseStatus::NetworkAuthenticationRequired: return "511 Network Authentication Required";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ESP_LOGW(TAG, "unknown httpd_err_code_t(%i)", std::to_underlying(status));
|
||||||
|
return "500 Internal Server Error";
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace esphttpdutils
|
} // namespace esphttpdutils
|
||||||
|
Reference in New Issue
Block a user