aboutsummaryrefslogblamecommitdiffstats
path: root/library/cpp/yson_pull/detail/fail.h
blob: 3e65b0f88775b3b57ba7f94df14b5866dec0df17 (plain) (tree)
1
2
3
4
5
6
7
8



                          
                                                
 

                                   
                                              






                                                                                
#pragma once

#include "format_string.h"
#include "macros.h"

#include <library/cpp/yson_pull/exceptions.h>
#include <library/cpp/yson_pull/position_info.h>

namespace NYsonPull {
    namespace NDetail {
        template <typename... Args>
        [[noreturn]] ATTRIBUTE(noinline, cold)
        void fail(
            const TPositionInfo& info,
            Args&&... args) {
            auto formatted_message = format_string(std::forward<Args>(args)...);
            throw NException::TBadInput(formatted_message, info);
        }
    }
}