Skip to content

Commit f61def5

Browse files
authored
Merge pull request #8 from dovidgef/main
Improve usefulness of error logging
2 parents b9717fb + 9d017e1 commit f61def5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const runTest = (wpt, url, options) => {
3838
return reject(err);
3939
}
4040
} catch (e) {
41-
core.info(e);
41+
core.info(e.statusText || JSON.stringify(e));
4242
}
4343
})
4444
});
@@ -82,7 +82,7 @@ async function renderComment(data) {
8282
body: markdown
8383
});
8484
} catch (e) {
85-
core.setFailed(`Action failed with error ${e}`);
85+
core.setFailed(`Action failed with error: ${e.statusText || JSON.stringify(e)}`);
8686
}
8787
}
8888
function collectData(results, runData) {
@@ -186,12 +186,12 @@ async function run() {
186186
return;
187187
}
188188
} catch (e) {
189-
core.setFailed(`Action failed with error ${e}`);
189+
core.setFailed(`Action failed with error: ${e.statusText || JSON.stringify(e)}`);
190190
}
191191

192192
});
193193
} catch (e) {
194-
core.setFailed(`Action failed with error ${e}`);
194+
core.setFailed(`Action failed with error: ${e.statusText || JSON.stringify(e)}`);
195195
}
196196
})).then(() => {
197197
if (isReportSupported()) {

0 commit comments

Comments
 (0)