dbus-sdk
Version:
A Node.js SDK for interacting with DBus, enabling seamless service calling and exposure with TypeScript support
18 lines (17 loc) • 789 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateDBusError = CreateDBusError;
/**
* Creates a DBus-specific Error object with a custom error name and message.
* This function is used to generate errors related to DBus operations with identifiable error names.
*
* @param DBusErrorName - The name of the DBus error (e.g., 'org.freedesktop.DBus.Error.Failed').
* This identifies the specific type of DBus error.
* @param message - A descriptive message explaining the cause of the error.
* @returns An Error object with the specified name and message, representing a DBus error.
*/
function CreateDBusError(DBusErrorName, message) {
const error = Error(message);
error.name = DBusErrorName;
return error;
}