fail.h 540 B

1234567891011121314151617181920
  1. #pragma once
  2. #include "format_string.h"
  3. #include "macros.h"
  4. #include <library/cpp/yson_pull/exceptions.h>
  5. #include <library/cpp/yson_pull/position_info.h>
  6. namespace NYsonPull {
  7. namespace NDetail {
  8. template <typename... Args>
  9. [[noreturn]] ATTRIBUTE(noinline, cold)
  10. void fail(
  11. const TPositionInfo& info,
  12. Args&&... args) {
  13. auto formatted_message = format_string(std::forward<Args>(args)...);
  14. throw NException::TBadInput(formatted_message, info);
  15. }
  16. }
  17. }