mulmocast 2.6.12 → 2.6.13

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.
@@ -1,5 +1,7 @@
1
1
  import type { MulmoStudioBeat, MulmoScript, MulmoPresentationStyle, MulmoStudioMultiLingual, FileObject } from "../types/type.js";
2
2
  export declare const silentMp3 = "https://github.com/receptron/mulmocast-cli/raw/refs/heads/main/assets/audio/silent300.mp3";
3
+ export type MulmoErrorFormatter = (error: unknown) => string | null;
4
+ export declare const setMulmoErrorFormatter: (formatter: MulmoErrorFormatter | null) => void;
3
5
  export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: string, videoCaptionLang?: string, presentationStyle?: MulmoPresentationStyle | null) => {
4
6
  script: {
5
7
  $mulmocast: {
@@ -5,6 +5,14 @@ import { mulmoStudioSchema, mulmoCaptionParamsSchema, mulmoPresentationStyleSche
5
5
  import { MulmoPresentationStyleMethods, MulmoScriptMethods, MulmoStudioMultiLingualMethod } from "../methods/index.js";
6
6
  import { loadMulmoConfig, mergeConfigWithScript } from "./mulmo_config.js";
7
7
  export const silentMp3 = "https://github.com/receptron/mulmocast-cli/raw/refs/heads/main/assets/audio/silent300.mp3";
8
+ let mulmoErrorFormatter = null;
9
+ export const setMulmoErrorFormatter = (formatter) => {
10
+ mulmoErrorFormatter = formatter;
11
+ };
12
+ const formatMulmoError = (error) => {
13
+ const formatted = mulmoErrorFormatter?.(error);
14
+ return formatted ?? `${error}`;
15
+ };
8
16
  const mulmoCredit = (speaker, isPortrait) => {
9
17
  return {
10
18
  id: "mulmo_credit",
@@ -145,7 +153,7 @@ export const initializeContextFromFiles = async (files, raiseError, force, withB
145
153
  };
146
154
  }
147
155
  catch (error) {
148
- GraphAILogger.info(`Error: invalid MulmoScript Schema: ${isHttpPath ? fileOrUrl : mulmoFilePath} \n ${error}`);
156
+ GraphAILogger.info(`Error: invalid MulmoScript Schema: ${isHttpPath ? fileOrUrl : mulmoFilePath} \n ${formatMulmoError(error)}`);
149
157
  if (raiseError) {
150
158
  throw error;
151
159
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mulmocast",
3
- "version": "2.6.12",
3
+ "version": "2.6.13",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.node.js",