@@ -34,7 +34,7 @@ pub struct Config {
3434 pub auth_notify_interval : Duration ,
3535 pub error_notify_cmd : Option < String > ,
3636 pub http_listen : String ,
37- pub not_transient_error_if : Option < String > ,
37+ pub transient_error_if_cmd : Option < String > ,
3838 refresh_at_least : Option < Duration > ,
3939 refresh_before_expiry : Option < Duration > ,
4040 refresh_retry : Option < Duration > ,
@@ -69,7 +69,7 @@ impl Config {
6969 let mut auth_notify_interval = None ;
7070 let mut error_notify_cmd = None ;
7171 let mut http_listen = None ;
72- let mut not_transient_error_if = None ;
72+ let mut transient_error_if_cmd = None ;
7373 let mut refresh_at_least = None ;
7474 let mut refresh_before_expiry = None ;
7575 let mut refresh_retry = None ;
@@ -130,12 +130,12 @@ impl Config {
130130 http_listen,
131131 ) ?)
132132 }
133- config_ast:: TopLevel :: NotTransientErrorIf ( span) => {
134- not_transient_error_if = Some ( check_not_assigned_str (
133+ config_ast:: TopLevel :: TransientErrorIfCmd ( span) => {
134+ transient_error_if_cmd = Some ( check_not_assigned_str (
135135 & lexer,
136- "not_transient_error_if " ,
136+ "transient_error_if_cmd " ,
137137 span,
138- not_transient_error_if ,
138+ transient_error_if_cmd ,
139139 ) ?)
140140 }
141141 config_ast:: TopLevel :: RefreshAtLeast ( span) => {
@@ -188,7 +188,7 @@ impl Config {
188188 . unwrap_or_else ( || Duration :: from_secs ( AUTH_NOTIFY_INTERVAL_DEFAULT ) ) ,
189189 error_notify_cmd,
190190 http_listen : http_listen. unwrap_or_else ( || HTTP_LISTEN_DEFAULT . to_owned ( ) ) ,
191- not_transient_error_if ,
191+ transient_error_if_cmd ,
192192 refresh_at_least,
193193 refresh_before_expiry,
194194 refresh_retry,
@@ -637,7 +637,7 @@ mod test {
637637 auth_notify_interval = 88m;
638638 error_notify_cmd = "j";
639639 http_listen = "127.0.0.1:56789";
640- not_transient_error_if = "k";
640+ transient_error_if_cmd = "k";
641641 token_event_cmd = "q";
642642 account "x" {
643643 // Mandatory fields
@@ -661,7 +661,7 @@ mod test {
661661 assert_eq ! ( c. auth_notify_cmd, Some ( "g" . to_owned( ) ) ) ;
662662 assert_eq ! ( c. auth_notify_interval, Duration :: from_secs( 88 * 60 ) ) ;
663663 assert_eq ! ( c. http_listen, "127.0.0.1:56789" . to_owned( ) ) ;
664- assert_eq ! ( c. not_transient_error_if , Some ( "k" . to_owned( ) ) ) ;
664+ assert_eq ! ( c. transient_error_if_cmd , Some ( "k" . to_owned( ) ) ) ;
665665 assert_eq ! ( c. token_event_cmd, Some ( "q" . to_owned( ) ) ) ;
666666
667667 let act = & c. accounts [ "x" ] ;
@@ -718,8 +718,8 @@ mod test {
718718 Err ( s) if s. contains ( "Mustn't specify 'token_event_cmd' more than once" ) => ( ) ,
719719 _ => panic ! ( ) ,
720720 }
721- match Config :: from_str ( r#"not_transient_error_if = "a"; not_transient_error_if = "b";"# ) {
722- Err ( s) if s. contains ( "Mustn't specify 'not_transient_error_if ' more than once" ) => ( ) ,
721+ match Config :: from_str ( r#"transient_error_if_cmd = "a"; transient_error_if_cmd = "b";"# ) {
722+ Err ( s) if s. contains ( "Mustn't specify 'transient_error_if_cmd ' more than once" ) => ( ) ,
723723 _ => panic ! ( ) ,
724724 }
725725 match Config :: from_str ( r#"http_listen = "a"; http_listen = "b";"# ) {
@@ -816,7 +816,7 @@ mod test {
816816 "# ,
817817 )
818818 . unwrap ( ) ;
819- assert_eq ! ( c. not_transient_error_if , None ) ;
819+ assert_eq ! ( c. transient_error_if_cmd , None ) ;
820820 assert_eq ! ( c. refresh_at_least, None ) ;
821821 assert_eq ! ( c. refresh_before_expiry, None ) ;
822822 assert_eq ! ( c. refresh_retry, None ) ;
@@ -829,7 +829,7 @@ mod test {
829829 // Global only
830830 let c = Config :: from_str (
831831 r#"
832- not_transient_error_if = "e";
832+ transient_error_if_cmd = "e";
833833 refresh_at_least = 1s;
834834 refresh_before_expiry = 2s;
835835 refresh_retry = 3s;
@@ -842,7 +842,7 @@ mod test {
842842 "# ,
843843 )
844844 . unwrap ( ) ;
845- assert_eq ! ( c. not_transient_error_if , Some ( "e" . to_owned( ) ) ) ;
845+ assert_eq ! ( c. transient_error_if_cmd , Some ( "e" . to_owned( ) ) ) ;
846846 assert_eq ! ( c. refresh_at_least, Some ( Duration :: from_secs( 1 ) ) ) ;
847847 assert_eq ! ( c. refresh_before_expiry, Some ( Duration :: from_secs( 2 ) ) ) ;
848848 assert_eq ! ( c. refresh_retry, Some ( Duration :: from_secs( 3 ) ) ) ;
@@ -868,7 +868,7 @@ mod test {
868868 )
869869 . unwrap ( ) ;
870870
871- assert_eq ! ( c. not_transient_error_if , None ) ;
871+ assert_eq ! ( c. transient_error_if_cmd , None ) ;
872872 assert_eq ! ( c. refresh_at_least, None ) ;
873873 assert_eq ! ( c. refresh_before_expiry, None ) ;
874874 assert_eq ! ( c. refresh_retry, None ) ;
@@ -881,7 +881,7 @@ mod test {
881881 // Local overrides global
882882 let c = Config :: from_str (
883883 r#"
884- not_transient_error_if = "e";
884+ transient_error_if_cmd = "e";
885885 refresh_at_least = 1s;
886886 refresh_before_expiry = 2s;
887887 refresh_retry = 3s;
@@ -897,7 +897,7 @@ mod test {
897897 "# ,
898898 )
899899 . unwrap ( ) ;
900- assert_eq ! ( c. not_transient_error_if , Some ( "e" . to_owned( ) ) ) ;
900+ assert_eq ! ( c. transient_error_if_cmd , Some ( "e" . to_owned( ) ) ) ;
901901 assert_eq ! ( c. refresh_at_least, Some ( Duration :: from_secs( 1 ) ) ) ;
902902 assert_eq ! ( c. refresh_before_expiry, Some ( Duration :: from_secs( 2 ) ) ) ;
903903 assert_eq ! ( c. refresh_retry, Some ( Duration :: from_secs( 3 ) ) ) ;
@@ -910,7 +910,7 @@ mod test {
910910 // Local overrides global
911911 let c = Config :: from_str (
912912 r#"
913- not_transient_error_if = "e";
913+ transient_error_if_cmd = "e";
914914 refresh_at_least = 1s;
915915 refresh_before_expiry = 2s;
916916 refresh_retry = 3s;
@@ -941,7 +941,7 @@ mod test {
941941 "# ,
942942 )
943943 . unwrap ( ) ;
944- assert_eq ! ( c. not_transient_error_if , Some ( "e" . to_owned( ) ) ) ;
944+ assert_eq ! ( c. transient_error_if_cmd , Some ( "e" . to_owned( ) ) ) ;
945945 assert_eq ! ( c. refresh_at_least, Some ( Duration :: from_secs( 1 ) ) ) ;
946946 assert_eq ! ( c. refresh_before_expiry, Some ( Duration :: from_secs( 2 ) ) ) ;
947947 assert_eq ! ( c. refresh_retry, Some ( Duration :: from_secs( 3 ) ) ) ;
0 commit comments