@@ -77,9 +77,9 @@ public isolated client class HubClient {
77
77
json | xml | byte [] payload = retrieveRequestPayload (contentType , message .content );
78
78
request .setPayload (payload );
79
79
error ? result = request .setContentType (contentType );
80
- if ( result is error ) {
81
- return error ContentDeliveryError (
82
- " Error occurred while setting content type " , result , statusCode = http : STATUS_BAD_REQUEST );
80
+ if result is error {
81
+ string errorMsg = string ` Error occurred while setting content type: ${ result . message ()} ` ;
82
+ return error ContentDeliveryError ( errorMsg , result , statusCode = http : STATUS_BAD_REQUEST );
83
83
}
84
84
request .setHeader (LINK , self .hubLinks );
85
85
string ? secret = self .secret ;
@@ -88,15 +88,15 @@ public isolated client class HubClient {
88
88
if hash is byte [] {
89
89
request .setHeader (X_HUB_SIGNATURE , string ` ${SHA256_HMAC }=${hash .toBase16 ()}` );
90
90
} else {
91
- return error ContentDeliveryError (
92
- " Error retrieving content signature " , hash , statusCode = http : STATUS_BAD_REQUEST );
91
+ string errorMsg = string ` Error retrieving content signature: ${ hash . message ()} ` ;
92
+ return error ContentDeliveryError ( errorMsg , hash , statusCode = http : STATUS_BAD_REQUEST );
93
93
}
94
94
}
95
95
http : Response | error response = self .httpClient -> post (" " , request );
96
96
if response is http : Response {
97
97
return processSubscriberResponse (response , self .topic );
98
98
} else {
99
- string errorMsg = string ` Content distribution failed for topic [${self .topic }]` ;
99
+ string errorMsg = string ` Content distribution failed for topic [${self .topic }]: ${ response . message ()} ` ;
100
100
return error ContentDeliveryError (errorMsg , statusCode = http : STATUS_INTERNAL_SERVER_ERROR );
101
101
}
102
102
}
0 commit comments