Skip to content

Commit

Permalink
fix: log the full URI, not only the base
Browse files Browse the repository at this point in the history
  • Loading branch information
wkillerud committed Jan 3, 2024
1 parent 7e3ef00 commit f42640e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/resolver.content.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default class PodletClientContentResolver {
});

this.#log.debug(
`start reading content from remote resource - manifest version is ${outgoing.manifest.version} - resource: ${outgoing.name} - url: ${outgoing.contentUri}`,
`start reading content from remote resource - manifest version is ${outgoing.manifest.version} - resource: ${outgoing.name} - url: ${uri}`,
);

try {
Expand All @@ -154,10 +154,10 @@ export default class PodletClientContentResolver {
});

this.#log.debug(
`remote resource responded with non 200 http status code for content - code: ${statusCode} - resource: ${outgoing.name} - url: ${outgoing.contentUri}`,
`remote resource responded with non 200 http status code for content - code: ${statusCode} - resource: ${outgoing.name} - url: ${uri}`,
);

const errorMessage = `Could not read content. Resource responded with ${statusCode} on ${outgoing.contentUri}`;
const errorMessage = `Could not read content. Resource responded with ${statusCode} on ${uri}`;

const errorOptions = {
statusCode,
Expand All @@ -178,7 +178,7 @@ export default class PodletClientContentResolver {
});

this.#log.warn(
`remote resource responded with non 200 http status code for content - code: ${statusCode} - resource: ${outgoing.name} - url: ${outgoing.contentUri}`,
`remote resource responded with non 200 http status code for content - code: ${statusCode} - resource: ${outgoing.name} - url: ${uri}`,
);
outgoing.success = true;
outgoing.pushFallback();
Expand All @@ -200,7 +200,7 @@ export default class PodletClientContentResolver {
: undefined;

this.#log.debug(
`got head response from remote resource for content - header version is ${hdrs['podlet-version']} - resource: ${outgoing.name} - url: ${outgoing.contentUri}`,
`got head response from remote resource for content - header version is ${hdrs['podlet-version']} - resource: ${outgoing.name} - url: ${uri}`,
);

if (
Expand All @@ -214,7 +214,7 @@ export default class PodletClientContentResolver {
});

this.#log.info(
`podlet version number in header differs from cached version number - aborting request to remote resource for content - resource: ${outgoing.name} - url: ${outgoing.contentUri}`,
`podlet version number in header differs from cached version number - aborting request to remote resource for content - resource: ${outgoing.name} - url: ${uri}`,
);

outgoing.status = 'stale';
Expand Down Expand Up @@ -258,10 +258,10 @@ export default class PodletClientContentResolver {
});

this.#log.warn(
`could not create network connection to remote resource when trying to request content - resource: ${outgoing.name} - url: ${outgoing.contentUri}`,
`could not create network connection to remote resource when trying to request content - resource: ${outgoing.name} - url: ${uri}`,
);
throw badGateway(
`Error reading content at ${outgoing.contentUri}`,
`Error reading content at ${uri}`,
error,
);
}
Expand All @@ -273,7 +273,7 @@ export default class PodletClientContentResolver {
});

this.#log.warn(
`could not create network connection to remote resource when trying to request content - resource: ${outgoing.name} - url: ${outgoing.contentUri}`,
`could not create network connection to remote resource when trying to request content - resource: ${outgoing.name} - url: ${uri}`,
);

outgoing.success = true;
Expand All @@ -297,7 +297,7 @@ export default class PodletClientContentResolver {
});

this.#log.debug(
`successfully read content from remote resource - resource: ${outgoing.name} - url: ${outgoing.contentUri}`,
`successfully read content from remote resource - resource: ${outgoing.name} - url: ${uri}`,
);

return outgoing;
Expand Down

0 comments on commit f42640e

Please sign in to comment.