Pass HTTP body to failure log

This commit is contained in:
Luc Perkins 2024-05-20 11:55:57 -03:00
parent afefc2fc85
commit a181f8e6e8
No known key found for this signature in database
GPG key ID: 16DB1108FB591835

View file

@ -277,13 +277,9 @@ class MagicNixCacheAction {
`http://${this.hostAndPort}/api/workflow-start`, `http://${this.hostAndPort}/api/workflow-start`,
); );
actionsCore.debug(
`post to /api/workflow-start (status: ${res.statusCode}, body: ${res.body})`,
);
if (res.statusCode !== 200) { if (res.statusCode !== 200) {
this.failInStrictMode( this.failInStrictMode(
`Failed to trigger workflow start hook; expected status 200 but got ${res.statusCode}`, `Failed to trigger workflow start hook; expected status 200 but got (status: ${res.statusCode}, body: ${res.body})`,
); );
} }
@ -320,13 +316,9 @@ class MagicNixCacheAction {
`http://${this.hostAndPort}/api/workflow-finish`, `http://${this.hostAndPort}/api/workflow-finish`,
); );
actionsCore.debug(
`post to /api/workflow-finish (status: ${res.statusCode}, body: ${res.body})`,
);
if (res.statusCode !== 200) { if (res.statusCode !== 200) {
this.failInStrictMode( this.failInStrictMode(
`Failed to trigger workflow finish hook; expected status 200 but got ${res.statusCode}`, `Failed to trigger workflow finish hook; expected status 200 but got (status: ${res.statusCode}, body: ${res.body})`,
); );
} }
} finally { } finally {