File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818
1919jobs :
2020 changelog-api-dry-run :
21- runs-on : ubuntu -latest
21+ runs-on : macos -latest
2222 permissions :
2323 contents : read
2424
@@ -149,8 +149,33 @@ jobs:
149149 });
150150 });
151151
152+ function formatRequestError(err) {
153+ if (!err) {
154+ return '(empty error)';
155+ }
156+ const lines = [`${err.name || 'Error'}: ${err.message || String(err)}`];
157+ if (err.code) {
158+ lines.push(`code: ${err.code}`);
159+ }
160+ if (err.address || err.port) {
161+ lines.push(`target: ${err.address || '(unknown address)'}:${err.port || '(unknown port)'}`);
162+ }
163+ if (Array.isArray(err.errors)) {
164+ for (const inner of err.errors) {
165+ lines.push(`cause: ${inner.name || 'Error'}: ${inner.message || String(inner)}`);
166+ if (inner.code) {
167+ lines.push(`cause code: ${inner.code}`);
168+ }
169+ if (inner.address || inner.port) {
170+ lines.push(`cause target: ${inner.address || '(unknown address)'}:${inner.port || '(unknown port)'}`);
171+ }
172+ }
173+ }
174+ return lines.join('\n');
175+ }
176+
152177 req.on('error', err => {
153- console.error(`Changelog API request failed: ${ err.message || err }`);
178+ console.error(`Changelog API request failed:\n${formatRequestError( err) }`);
154179 process.exit(1);
155180 });
156181
You can’t perform that action at this time.
0 commit comments