File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1111#include  < chrono> 
1212#include  < exception> 
1313#include  < string> 
14+ #include  < source_location> 
1415
1516
1617namespace  KAFKA_API  {
@@ -21,10 +22,10 @@ namespace KAFKA_API {
2122class  KafkaException : public  std ::exception
2223{
2324public: 
24-     KafkaException (const  char * filename,  std::size_t  lineno , const  Error& error)
25+     KafkaException (const  std::source_location location =  std::source_location::current() , const  Error& error)
2526        : _when(std::chrono::system_clock::now()),
26-           _filename (filename ),
27-           _lineno(lineno ),
27+           _filename (location.file_name() ),
28+           _lineno(location.line() ),
2829          _error(std::make_shared<Error>(error))
2930    {}
3031
@@ -53,7 +54,7 @@ class KafkaException: public std::exception
5354};
5455
5556
56- #define  KAFKA_THROW_ERROR (error )          throw  KafkaException (__FILE__, __LINE__,  error)
57+ #define  KAFKA_THROW_ERROR (error )          throw  KafkaException (error)
5758#define  KAFKA_THROW_IF_WITH_ERROR (error )  if  (error) KAFKA_THROW_ERROR(error)
5859
5960} //  end of KAFKA_API
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments