Log more details in schema service (#1339)

This commit is contained in:
Kamil Kisiela 2023-02-10 14:18:46 +01:00 committed by GitHub
parent 9aff954c11
commit fef712e767
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -243,7 +243,13 @@ const createFederation: (
};
const response: unknown = await retry(
async () => {
async (_, attempt) => {
logger.debug(
'Calling external composition service (broker=%s, attempt=%s, url=%s)',
external.broker ? 'yes' : 'no',
attempt,
external.endpoint,
);
const res = await (external.broker
? fetch(external.broker.endpoint, {
method: 'POST',
@ -300,7 +306,11 @@ const createFederation: (
).catch(async error => {
// The expected error
if (error instanceof NetworkError) {
logger.info('Network error so return failure');
logger.info(
'Network error so return failure (status=%s, message=%s)',
error.statusCode,
error.message,
);
return {
type: 'failure',
result: {