File tree 2 files changed +12
-6
lines changed
2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,10 @@ public function lookup(string $topic): Result
124
124
125
125
//
126
126
default :
127
- throw new RuntimeException ($ subCommand ->getMessage ());
127
+ throw new RuntimeException (
128
+ $ subCommand ->getMessage () ?: $ subCommand ->getError ()->name (),
129
+ $ subCommand ->getError ()->value ()
130
+ );
128
131
}
129
132
}
130
133
@@ -152,7 +155,10 @@ public function getPartitionedTopicMetadata(string $topic): int
152
155
*/
153
156
$ subCommand = $ results ->subCommand ;
154
157
if ($ subCommand ->getResponse ()->value () == CommandPartitionedTopicMetadataResponse \LookupType::Failed_VALUE) {
155
- throw new RuntimeException ($ subCommand ->getMessage ());
158
+ throw new RuntimeException (
159
+ $ subCommand ->getMessage () ?: $ subCommand ->getError ()->name (),
160
+ $ subCommand ->getError ()->value ()
161
+ );
156
162
}
157
163
158
164
return $ subCommand ->getPartitions ();
@@ -214,4 +220,4 @@ public function close()
214
220
{
215
221
$ this ->connection ->close ();
216
222
}
217
- }
223
+ }
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ protected function checkError()
111
111
{
112
112
if ($ this ->subCommand instanceof CommandError) {
113
113
throw new RuntimeException (
114
- $ this ->subCommand ->getMessage (),
114
+ $ this ->subCommand ->getMessage () ?: $ this -> subCommand -> getError ()-> name () ,
115
115
$ this ->subCommand ->getError ()->value ()
116
116
);
117
117
}
@@ -128,9 +128,9 @@ protected function checkServerError()
128
128
{
129
129
if ($ this ->subCommand instanceof CommandSendError) {
130
130
throw new RuntimeException (
131
- $ this ->subCommand ->getMessage (),
131
+ $ this ->subCommand ->getMessage () ?: $ this -> subCommand -> getError ()-> name () ,
132
132
$ this ->subCommand ->getError ()->value ()
133
133
);
134
134
}
135
135
}
136
- }
136
+ }
You can’t perform that action at this time.
0 commit comments