@httptoolkit/dbus-native
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -159,3 +159,13 @@ const EventEmitter = require('events').EventEmitter; | ||
} else { | ||
handler.call(props, args); // body as first argument | ||
// Turn single-string error response into proper error instance: | ||
if (args.length === 1 && typeof args[0] === 'string') { | ||
const errMessage = args[0]; | ||
const errName = msg.errorName ?? 'DbusError'; | ||
args = Object.assign( | ||
new Error(`${errName}: ${errMessage}`, { | ||
name: errName | ||
}) | ||
); | ||
} | ||
handler.call(props, args); // body as first (error) argument | ||
} | ||
@@ -162,0 +172,0 @@ } |
{ | ||
"name": "@httptoolkit/dbus-native", | ||
"author": "Tim Perry <tim@httptoolkit.com>", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "dbus", |
@@ -24,2 +24,3 @@ # @httptoolkit/dbus-native [![Build Status](https://github.com/httptoolkit/dbus-native/workflows/CI/badge.svg)](https://github.com/httptoolkit/dbus-native/actions) | ||
* Throws an explicit error when sending a message to a closed stream, instead of silently never responding | ||
* Turn D-Bus error responses into proper error instances where possible (rather than throwing arrays of strings) | ||
@@ -26,0 +27,0 @@ Installation |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
75721
2053
134