@matterbridge/dgram 3.7.1-dev-20260324-7b86640 → 3.7.1-dev-20260324-9c29691
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/coap.js +2 -1
- package/dist/dgram.js +4 -3
- package/package.json +3 -2
package/dist/coap.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getErrorMessage } from '@matterbridge/utils/error';
|
|
1
2
|
import { BLUE, db, GREEN, MAGENTA, nf } from 'node-ansi-logger';
|
|
2
3
|
import { COAP_MULTICAST_IPV4_ADDRESS, COAP_MULTICAST_PORT, Multicast } from './multicast.js';
|
|
3
4
|
export const COAP_OPTION_URI_PATH = 11;
|
|
@@ -21,7 +22,7 @@ export class Coap extends Multicast {
|
|
|
21
22
|
this.logCoapMessage(result);
|
|
22
23
|
}
|
|
23
24
|
catch (error) {
|
|
24
|
-
this.log.error(`Error decoding CoAP message: ${error
|
|
25
|
+
this.log.error(`Error decoding CoAP message: ${getErrorMessage(error)}`);
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
decodeCoapMessage(msg) {
|
package/dist/dgram.js
CHANGED
|
@@ -2,6 +2,7 @@ import dgram from 'node:dgram';
|
|
|
2
2
|
import EventEmitter from 'node:events';
|
|
3
3
|
import os from 'node:os';
|
|
4
4
|
import { hasParameter } from '@matterbridge/utils/cli';
|
|
5
|
+
import { getErrorMessage } from '@matterbridge/utils/error';
|
|
5
6
|
import { AnsiLogger, BLUE, db, idn, nf, rs } from 'node-ansi-logger';
|
|
6
7
|
export class Dgram extends EventEmitter {
|
|
7
8
|
verbose = hasParameter('v') || hasParameter('verbose');
|
|
@@ -28,7 +29,7 @@ export class Dgram extends EventEmitter {
|
|
|
28
29
|
this.interfaceAddress = interfaceAddress;
|
|
29
30
|
this.log.debug(`Created socket of type ${BLUE}${socketType}${db} on interface ${BLUE}${interfaceName || 'any'}${db} with address ${BLUE}${interfaceAddress || 'any'}${db} reuseAddr=${BLUE}${reuseAddr}${db}`);
|
|
30
31
|
this.socket.on('error', (error) => {
|
|
31
|
-
this.log.debug(`Socket error: ${error
|
|
32
|
+
this.log.debug(`Socket error: ${getErrorMessage(error)}`);
|
|
32
33
|
this.emit('error', error);
|
|
33
34
|
this.onError(error);
|
|
34
35
|
});
|
|
@@ -59,7 +60,7 @@ export class Dgram extends EventEmitter {
|
|
|
59
60
|
send(msg, serverAddress, serverPort) {
|
|
60
61
|
this.socket.send(msg, 0, msg.length, serverPort, serverAddress, (error) => {
|
|
61
62
|
if (error) {
|
|
62
|
-
this.log.error(`Socket failed to send a message: ${error
|
|
63
|
+
this.log.error(`Socket failed to send a message: ${getErrorMessage(error)}`);
|
|
63
64
|
this.emit('error', error);
|
|
64
65
|
this.onError(error);
|
|
65
66
|
}
|
|
@@ -71,7 +72,7 @@ export class Dgram extends EventEmitter {
|
|
|
71
72
|
});
|
|
72
73
|
}
|
|
73
74
|
onError(error) {
|
|
74
|
-
this.log.error(`Socket error: ${error
|
|
75
|
+
this.log.error(`Socket error: ${getErrorMessage(error)}`);
|
|
75
76
|
}
|
|
76
77
|
onClose() {
|
|
77
78
|
this.log.info(`Socket closed`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matterbridge/dgram",
|
|
3
|
-
"version": "3.7.1-dev-20260324-
|
|
3
|
+
"version": "3.7.1-dev-20260324-9c29691",
|
|
4
4
|
"description": "Matterbridge dgram library",
|
|
5
5
|
"author": "https://github.com/Luligu",
|
|
6
6
|
"homepage": "https://matterbridge.io/",
|
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
"CHANGELOG.md"
|
|
62
62
|
],
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@matterbridge/jest-utils": "3.7.1-dev-20260324-
|
|
64
|
+
"@matterbridge/jest-utils": "3.7.1-dev-20260324-9c29691",
|
|
65
|
+
"@matterbridge/utils": "3.7.1-dev-20260324-9c29691",
|
|
65
66
|
"node-ansi-logger": "3.2.0"
|
|
66
67
|
}
|
|
67
68
|
}
|