Page 1 of 1

esp_http_server: How do I override built-in 404 handler?

Posted: Sat Jun 12, 2021 11:09 pm
by mchahn
I'm using esp_http_server in a esp32-cam. I want to do some processing when I return a 404. The library seems to be returning the 404 responses without using my code. How can I handle the 404 and override the built-in one?

Re: esp_http_server: How do I override built-in 404 handler?

Posted: Sun Jun 13, 2021 7:12 am
by Victoria Nope
You can register your own error handler with the httpd_register_err_handler function.

Re: esp_http_server: How do I override built-in 404 handler?

Posted: Mon Jun 14, 2021 3:45 am
by mchahn
Thanks. I really did try to figure it out in the docs.