2626import com .huaweicloud .servicecomb .discovery .client .model .SchemaRequest ;
2727import com .huaweicloud .servicecomb .discovery .client .model .SchemaResponse ;
2828import com .huaweicloud .servicecomb .discovery .discovery .MicroserviceHandler ;
29+
2930import java .io .IOException ;
3031import java .net .URI ;
3132import java .net .URISyntaxException ;
3536
3637import java .util .Map ;
3738import java .util .stream .Collectors ;
39+
3840import org .apache .http .HttpStatus ;
3941import org .apache .http .client .utils .URIBuilder ;
4042import org .apache .http .entity .ByteArrayEntity ;
4446import org .slf4j .LoggerFactory ;
4547import org .springframework .cloud .client .DefaultServiceInstance ;
4648import org .springframework .cloud .client .ServiceInstance ;
49+
4750import com .huaweicloud .common .cache .RegisterCache ;
4851import com .huaweicloud .common .exception .RemoteOperationException ;
4952import com .huaweicloud .common .exception .RemoteServerUnavailableException ;
6265
6366import com .fasterxml .jackson .databind .ObjectMapper ;
6467import com .fasterxml .jackson .databind .SerializationFeature ;
68+
6569import org .springframework .util .StringUtils ;
6670
6771
@@ -388,7 +392,7 @@ public MicroserviceInstanceSingleResponse getInstance(String serviceId, String i
388392 } else {
389393 throw new RemoteOperationException (
390394 "read response failed. status:" + response .getStatusCode () + "; message:" + response
391- .getStatusMessage () + "; content:" + response .getContent ());
395+ .getStatusMessage () + "; content:" + response .getContent ());
392396 }
393397 } catch (URISyntaxException e ) {
394398 throw new RemoteOperationException ("build url failed." , e );
@@ -423,7 +427,7 @@ public HeardBeatStatus heartbeat(HeartbeatRequest heartbeatRequest) throws Servi
423427 throw new RemoteOperationException ("build url failed." , e );
424428 } catch (IOException e ) {
425429 toggle ();
426- throw new RemoteOperationException ("read response failed. " , e );
430+ throw new RemoteOperationException ("read response failed , msg: {} " + response , e );
427431 }
428432 }
429433
@@ -443,7 +447,7 @@ public boolean updateInstanceStatus(String serviceId, String instanceId, String
443447 }
444448 throw new RemoteOperationException (
445449 "update instance status failed. status:" + response .getStatusCode () + "; message:"
446- + response .getStatusMessage () + "; content:" + response .getContent ());
450+ + response .getStatusMessage () + "; content:" + response .getContent ());
447451 } catch (URISyntaxException e ) {
448452 throw new RemoteOperationException ("build url failed." , e );
449453 }
@@ -461,7 +465,7 @@ public MicroserviceResponse getServices() throws ServiceCombException {
461465 } else {
462466 throw new RemoteOperationException (
463467 "read response failed. status:" + response .getStatusCode () + "; message:" + response
464- .getStatusMessage () + "; content:" + response .getContent ());
468+ .getStatusMessage () + "; content:" + response .getContent ());
465469 }
466470 } catch (URISyntaxException e ) {
467471 throw new RemoteOperationException ("build url failed." , e );
0 commit comments