File tree Expand file tree Collapse file tree 2 files changed +2
-3
lines changed Expand file tree Collapse file tree 2 files changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ class Stat
1313 MODES = [ :SERVER , :CLIENT ] . freeze
1414
1515 ERROR_TRANSLATIONS = {
16- ::Protobuf ::Socketrpc ::ErrorReason ::NONE => "OK" ,
1716 ::Protobuf ::Socketrpc ::ErrorReason ::BAD_REQUEST_DATA => "BAD_REQUEST_DATA" ,
1817 ::Protobuf ::Socketrpc ::ErrorReason ::BAD_REQUEST_PROTO => "BAD_REQUEST_PROTO" ,
1918 ::Protobuf ::Socketrpc ::ErrorReason ::SERVICE_NOT_FOUND => "SERVICE_NOT_FOUND" ,
@@ -30,7 +29,6 @@ def initialize(mode = :SERVER)
3029 @mode = mode
3130 @request_size = 0
3231 @response_size = 0
33- @status = ::Protobuf ::Socketrpc ::ErrorReason ::NONE # default to NONE and only set if error occurs
3432 start
3533 end
3634
@@ -95,6 +93,8 @@ def client?
9593 end
9694
9795 def status_string
96+ return "OK" if status . nil?
97+
9898 ERROR_TRANSLATIONS . fetch ( status , "UNKNOWN_ERROR" )
9999 end
100100
Original file line number Diff line number Diff line change @@ -66,5 +66,4 @@ enum ErrorReason
6666 BAD_RESPONSE_PROTO = 7 ; // Server returned a bad response proto
6767 UNKNOWN_HOST = 8 ; // Could not find supplied host
6868 IO_ERROR = 9 ; // I/O error while communicating with server
69- NONE = 10000 ; // No error. Typically not used. This is a placeholder to remind us not to use this value.
7069}
You can’t perform that action at this time.
0 commit comments