"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.createUnknownSendMessageError = void 0;
const assert_1 = __importDefault(require("../../utils/assert"));
/**
 * Helper to wrap arbitrary errors into SendMessageError structures.
 * Enforces that the raw string is non-empty for defensive debugging.
 */
const createUnknownSendMessageError = (raw) => {
    (0, assert_1.default)(typeof raw === "string", "Expected raw error to be a string");
    const trimmed = raw.trim();
    (0, assert_1.default)(trimmed.length > 0, "createUnknownSendMessageError requires a non-empty message");
    return {
        type: "unknown",
        raw: trimmed,
    };
};
exports.createUnknownSendMessageError = createUnknownSendMessageError;
//# sourceMappingURL=sendMessageError.js.map