esp_exception.h 692 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef _ESP_EXCEPTION_H_
  7. #define _ESP_EXCEPTION_H_
  8. //
  9. // This exception stub is enabled only if exceptions are disabled in menuconfig
  10. //
  11. #if !defined(CONFIG_COMPILER_CXX_EXCEPTIONS) && defined (ASIO_NO_EXCEPTIONS)
  12. #include "esp_log.h"
  13. //
  14. // asio exception stub
  15. //
  16. namespace asio {
  17. namespace detail {
  18. template <typename Exception>
  19. void throw_exception(const Exception& e)
  20. {
  21. ESP_LOGE("esp32_asio_exception", "Caught exception: %s!", e.what());
  22. abort();
  23. }
  24. }}
  25. #endif // CONFIG_COMPILER_CXX_EXCEPTIONS==1 && defined (ASIO_NO_EXCEPTIONS)
  26. #endif // _ESP_EXCEPTION_H_