export const makeServerError = (error, { critical = "critical" in error ? error.critical : false, } = {}) => {
    if (error instanceof Error) {
        return {
            type: "server/error",
            timestamp: new Date().toISOString(),
            stackTrace: error.stack,
            message: error.message,
            name: error.name,
            critical,
        };
    }
    return {
        type: "server/error",
        timestamp: new Date().toISOString(),
        message: "An unknown error occurred",
        name: "UnknownError",
        ...error,
        critical,
    };
};
//# sourceMappingURL=make-server-error.js.map