aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yson_pull/detail/fail.h
blob: ad869af510c5bde86267c0f25811f1c23207fac0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#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> 
        ATTRIBUTE(noreturn, noinline, cold) 
        void fail( 
            const TPositionInfo& info, 
            Args&&... args) { 
            auto formatted_message = format_string(std::forward<Args>(args)...); 
            throw NException::TBadInput(formatted_message, info); 
        } 
    } 
}