{"record":{"id":"53054ce8f461a058","repo":"affaan-m/ECC","slug":"unknown-effect-mode","errorCode":null,"errorMessage":"Unknown effect mode","messagePattern":"Unknown effect mode","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"skills/taste-application/scripts/tasteforge/media/glitch.py","lineNumber":116,"sourceCode":"\n\ndef render(\n    source,\n    start,\n    duration,\n    output,\n    seed,\n    mode=\"drift\",\n    width=1920,\n    height=1080,\n    fps=30,\n    overwrite=False,\n):\n    geometry(width, height, fps, duration)\n    if not math.isfinite(start) or start < 0:\n        raise ValueError(\"Start must be finite and nonnegative\")\n    if mode not in (\"drift\", \"feedback\", \"pixelsort\", \"mosh\"):\n        raise ValueError(\"Unknown effect mode\")\n    if not Path(source).is_file():\n        raise FileNotFoundError(source)\n    if isinstance(seed, bool) or not isinstance(seed, int) or seed < 0:\n        raise ValueError(\"Seed must be a nonnegative integer\")\n    if Path(source).resolve() == Path(output).resolve():\n        raise ValueError(\"Output must differ from the original source media\")\n    with output_file(output, overwrite) as temporary:\n        dec = subprocess.Popen(\n            [\n                \"ffmpeg\",\n                \"-nostdin\",\n                \"-v\",\n                \"error\",\n                \"-ss\",\n                str(start),\n                \"-t\",\n                str(duration),\n                \"-i\",","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-application/scripts/tasteforge/media/glitch.py#L98-L134","documentation":"render() only supports the effect modes 'drift', 'feedback', 'pixelsort', and 'mosh'. Any other mode string raises ValueError('Unknown effect mode'). This is a closed enum validated before any subprocess work.","triggerScenarios":"Passing mode='glitch', mode='datamosh', a typo like 'pixsort', or None/empty string to render(); wiring mode from an unvalidated CLI flag or config value.","commonSituations":"Typo in the mode string; copying mode names from a different tool's docs; passing the enum from an incompatible version of the library; forwarding user input without whitelisting.","solutions":["Use one of the supported modes: 'drift', 'feedback', 'pixelsort', 'mosh'","Check spelling against the accepted tuple in render()","Validate/normalize user-supplied mode against the whitelist before calling render()","Check the library version if a mode you expected is missing — it may not exist in this release"],"exampleFix":"// before\nrender(src, 0, out, mode='datamosh')\n// after\nrender(src, 0, out, mode='mosh')","handlingStrategy":"validation","validationCode":"VALID_MODES = {'drift','feedback','pixelsort','mosh'}\nif mode not in VALID_MODES:\n    raise ValueError(f'mode must be one of {sorted(VALID_MODES)}')","typeGuard":"def is_valid_mode(mode) -> bool:\n    return mode in ('drift', 'feedback', 'pixelsort', 'mosh')","tryCatchPattern":"try:\n    render(src, 0, out, mode=mode)\nexcept ValueError as e:\n    if 'Unknown effect mode' in str(e):\n        print(f'{mode!r} unsupported; use drift|feedback|pixelsort|mosh')","preventionTips":["Use an enum or Literal type for mode in calling code","Whitelist/normalize user CLI input before forwarding","Keep a single source-of-truth constant for supported modes","Copy mode names directly from the library docs, not other tools"],"tags":["validation","enum","media"],"backgroundTag":"invalid-enum-value","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}