Skip to content

Commit b34f243

Browse files
committed
fix: consistently log the payload on errors with Homebase API calls
It may be useful to see for which payload the API call fails. We already do this in one place, so this fix attempts to make it consistent across all calls.
1 parent 99af781 commit b34f243

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/transmitter/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ export async function sendDepGraph(...payloads: IDepGraphPayload[]) {
2222
throw new Error(`${result.statusCode} ${result.statusMessage}`);
2323
}
2424
} catch (error) {
25-
logger.error({error}, 'could not send the dependency scan result to Homebase');
25+
const { dependencyGraph, ...payloadWithoutDepGraph } = payload;
26+
logger.error({error, payload: payloadWithoutDepGraph}, 'could not send the dependency scan result to Homebase');
2627
}
2728
}
2829
}
@@ -39,7 +40,7 @@ export async function sendWorkloadMetadata(payload: IWorkloadMetadataPayload) {
3940
throw new Error(`${result.statusCode} ${result.statusMessage}`);
4041
}
4142
} catch (error) {
42-
logger.error({error}, 'could not send workload metadata to Homebase');
43+
logger.error({error, payload: payload.workloadLocator}, 'could not send workload metadata to Homebase');
4344
}
4445
}
4546

0 commit comments

Comments
 (0)