Skip to content

Commit 3557e4b

Browse files
author
Steve Newell
committed
remove enum NONE
1 parent 0f03ed2 commit 3557e4b

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/protobuf/rpc/stat.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

proto/rpc.proto

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)