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