@@ -110,7 +110,8 @@ public static RemotingCommand createResponseCommand(Class<? extends CommandCusto
110
110
return createResponseCommand (RemotingSysResponseCode .SYSTEM_ERROR , "not set any response code" , classHeader );
111
111
}
112
112
113
- public static RemotingCommand createResponseCommand (int code , String remark , Class <? extends CommandCustomHeader > classHeader ) {
113
+ public static RemotingCommand createResponseCommand (int code , String remark ,
114
+ Class <? extends CommandCustomHeader > classHeader ) {
114
115
RemotingCommand cmd = new RemotingCommand ();
115
116
cmd .markResponseType ();
116
117
cmd .setCode (code );
@@ -230,7 +231,8 @@ public void writeCustomHeader(CommandCustomHeader customHeader) {
230
231
this .customHeader = customHeader ;
231
232
}
232
233
233
- public CommandCustomHeader decodeCommandCustomHeader (Class <? extends CommandCustomHeader > classHeader ) throws RemotingCommandException {
234
+ public CommandCustomHeader decodeCommandCustomHeader (
235
+ Class <? extends CommandCustomHeader > classHeader ) throws RemotingCommandException {
234
236
CommandCustomHeader objectHeader ;
235
237
try {
236
238
objectHeader = classHeader .newInstance ();
@@ -279,6 +281,7 @@ public CommandCustomHeader decodeCommandCustomHeader(Class<? extends CommandCust
279
281
field .set (objectHeader , valueParsed );
280
282
281
283
} catch (Throwable e ) {
284
+ log .error ("Failed field [{}] decoding" , fieldName , e );
282
285
}
283
286
}
284
287
}
@@ -384,8 +387,8 @@ public void makeCustomHeaderToNet() {
384
387
try {
385
388
field .setAccessible (true );
386
389
value = field .get (this .customHeader );
387
- } catch (IllegalArgumentException e ) {
388
- } catch ( IllegalAccessException e ) {
390
+ } catch (Exception e ) {
391
+ log . error ( "Failed to access field [{}]" , name , e );
389
392
}
390
393
391
394
if (value != null ) {
@@ -401,7 +404,6 @@ public ByteBuffer encodeHeader() {
401
404
return encodeHeader (this .body != null ? this .body .length : 0 );
402
405
}
403
406
404
-
405
407
public ByteBuffer encodeHeader (final int bodyLength ) {
406
408
// 1> header length size
407
409
int length = 4 ;
0 commit comments