Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).

### Unreleased

- fix(outbound): in outbound, fix a crash when socket connection errors #3456

### [3.1.0] - 2025-01-30

#### Changes
Expand Down
9 changes: 8 additions & 1 deletion outbound/client_pool.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

const util = require('node:util');

const utils = require('haraka-utils');
const net_utils = require('haraka-net-utils')

Expand Down Expand Up @@ -32,7 +34,12 @@
socket.end();
socket.removeAllListeners();
socket.destroy();
callback(err.message, null);
const errMsg = err.message ?
err.message :
err instanceof AggregateError ?
err.map(e => e.message).join(', ') :
util.inspect(err, { depth: 3 });
callback(errMsg, null);

Check warning on line 42 in outbound/client_pool.js

View check run for this annotation

Codecov / codecov/patch

outbound/client_pool.js#L37-L42

Added lines #L37 - L42 were not covered by tests
})

socket.once('timeout', () => {
Expand Down
Loading