File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
metrics-exporter-dogstatsd/src/forwarder Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -85,10 +85,13 @@ impl ClientState {
85
85
let old_state = std:: mem:: replace ( self , ClientState :: Inconsistent ) ;
86
86
match old_state {
87
87
ClientState :: Inconsistent => unreachable ! ( "transitioned _from_ inconsistent state" ) ,
88
- ClientState :: Disconnected ( config) => {
89
- let client = Client :: from_forwarder_config ( & config) ?;
90
- * self = ClientState :: Ready ( config, client) ;
91
- }
88
+ ClientState :: Disconnected ( config) => match Client :: from_forwarder_config ( & config) {
89
+ Ok ( client) => * self = ClientState :: Ready ( config, client) ,
90
+ Err ( e) => {
91
+ * self = ClientState :: Disconnected ( config) ;
92
+ return Err ( e) ;
93
+ }
94
+ } ,
92
95
ClientState :: Ready ( config, mut client) => {
93
96
let result = client. send ( payload) ;
94
97
if result. is_ok ( ) {
You can’t perform that action at this time.
0 commit comments