@@ -1641,29 +1641,26 @@ void nr_txn_record_error(nrtxn_t* txn,
1641
1641
nr_free (span_id );
1642
1642
}
1643
1643
1644
- void nr_txn_record_error_with_additional_attributes (nrtxn_t * txn ,
1645
- int priority ,
1646
- bool add_to_current_segment ,
1647
- const char * error_message ,
1648
- const char * error_class ,
1649
- const char * error_file ,
1650
- int error_line ,
1651
- char * error_context ,
1652
- int error_no ,
1653
- const char * stacktrace_json ) {
1644
+ void nr_txn_record_error_with_additional_attributes (
1645
+ nrtxn_t * txn ,
1646
+ int priority ,
1647
+ bool add_to_current_segment ,
1648
+ const char * error_message ,
1649
+ const char * error_class ,
1650
+ const char * error_file ,
1651
+ int error_line ,
1652
+ char * error_context ,
1653
+ int error_no ,
1654
+ const char * stacktrace_json ) {
1654
1655
nr_segment_t * current_segment = NULL ;
1655
1656
char * span_id = NULL ;
1656
1657
nr_error_t * error = NULL ;
1657
1658
1658
- if (nrunlikely ((0 == txn ) || (0 == txn -> options .err_enabled ) || (0 == error_message )
1659
- || (0 == txn -> status .recording )
1660
- || (0 == error_message [0 ])
1661
- || (0 == stacktrace_json )
1662
- || (0 == error_class )
1663
- || (0 == error_file )
1664
- || (0 == error_line )
1665
- || (0 == error_context )
1666
- || (0 == error_no ))) {
1659
+ if (nrunlikely ((0 == txn ) || (0 == txn -> options .err_enabled )
1660
+ || (0 == error_message ) || (0 == txn -> status .recording )
1661
+ || (0 == error_message [0 ]) || (0 == stacktrace_json )
1662
+ || (0 == error_class ) || (0 == error_file ) || (0 == error_line )
1663
+ || (0 == error_context ) || (0 == error_no ))) {
1667
1664
return ;
1668
1665
}
1669
1666
@@ -1700,41 +1697,50 @@ void nr_txn_record_error_with_additional_attributes(nrtxn_t* txn,
1700
1697
current_segment = nr_txn_get_current_segment (txn , NULL );
1701
1698
1702
1699
if (current_segment ) {
1703
- nr_segment_set_error_with_additional_params (current_segment , error_message , error_class , error_file , error_line , error_context , error_no );
1700
+ nr_segment_set_error_with_additional_params (
1701
+ current_segment , error_message , error_class , error_file , error_line ,
1702
+ error_context , error_no );
1704
1703
nrl_verbosedebug (NRL_TXN ,
1705
- "recording segment error: msg='%.48s' cls='%.48s' file='%.48s' line='%d' context='%.48s' num='%d'"
1704
+ "recording segment error: msg='%.48s' cls='%.48s' "
1705
+ "file='%.48s' line='%d' context='%.48s' num='%d'"
1706
1706
"span_id='%.48s'" ,
1707
- NRSAFESTR (error_message ), NRSAFESTR (error_class ), NRSAFESTR (error_file ), error_line , NRSAFESTR (error_context ), error_no ,
1707
+ NRSAFESTR (error_message ), NRSAFESTR (error_class ),
1708
+ NRSAFESTR (error_file ), error_line ,
1709
+ NRSAFESTR (error_context ), error_no ,
1708
1710
NRSAFESTR (span_id ));
1709
1711
}
1710
1712
}
1711
1713
}
1712
- error = nr_error_create_additional_params (priority , error_message , error_class , error_file ,
1713
- error_line , error_context , error_no , stacktrace_json ,
1714
- span_id , nr_get_time ());
1714
+ error = nr_error_create_additional_params (
1715
+ priority , error_message , error_class , error_file , error_line ,
1716
+ error_context , error_no , stacktrace_json , span_id , nr_get_time ());
1715
1717
1716
1718
/*
1717
1719
* Ensure previous error is destroyed only we have a valid one to replace it
1718
1720
* with.
1719
1721
*/
1720
-
1722
+
1721
1723
if (nrunlikely (NULL == error )) {
1722
1724
nrl_verbosedebug (NRL_TXN ,
1723
1725
"The following returned NULL from create error: "
1724
- "priority=%d msg='%.48s' cls='%.48s' file='%.48s' line='%d' context='%.48s' num='%d' span_id='%.48s'" ,
1725
- priority , NRSAFESTR (error_message ), NRSAFESTR (error_class ), NRSAFESTR (error_file ), error_line , NRSAFESTR (error_context ), error_no ,
1726
- NRSAFESTR (span_id ));
1726
+ "priority=%d msg='%.48s' cls='%.48s' file='%.48s' "
1727
+ "line='%d' context='%.48s' num='%d' span_id='%.48s'" ,
1728
+ priority , NRSAFESTR (error_message ), NRSAFESTR (error_class ),
1729
+ NRSAFESTR (error_file ), error_line ,
1730
+ NRSAFESTR (error_context ), error_no , NRSAFESTR (span_id ));
1727
1731
return ;
1728
1732
}
1729
1733
if (txn -> error ) {
1730
1734
nr_error_destroy_additional_params (& txn -> error );
1731
1735
}
1732
1736
txn -> error = error ;
1733
1737
nrl_verbosedebug (NRL_TXN ,
1734
- "recording error priority=%d msg='%.48s' cls='%.48s' file='%.48s' line='%d' context='%.48s' num='%d'"
1738
+ "recording error priority=%d msg='%.48s' cls='%.48s' "
1739
+ "file='%.48s' line='%d' context='%.48s' num='%d'"
1735
1740
"span_id='%.48s'" ,
1736
- priority , NRSAFESTR (error_message ), NRSAFESTR (error_class ), NRSAFESTR (error_file ), error_line , NRSAFESTR (error_context ), error_no ,
1737
- NRSAFESTR (span_id ));
1741
+ priority , NRSAFESTR (error_message ), NRSAFESTR (error_class ),
1742
+ NRSAFESTR (error_file ), error_line , NRSAFESTR (error_context ),
1743
+ error_no , NRSAFESTR (span_id ));
1738
1744
nr_free (span_id );
1739
1745
}
1740
1746
0 commit comments