{"record":{"id":"420972d6a00908a8","repo":"ATH-MaaS/Pixelle-Video","slug":"str-e-420972","errorCode":null,"errorMessage":"str(e)","messagePattern":"str\\(e\\)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"api/routers/frame.py","lineNumber":83,"sourceCode":"        # Create HTML frame generator\n        generator = HTMLFrameGenerator(template_path)\n        \n        # Generate frame\n        frame_path = await generator.generate_frame(\n            title=request.title,\n            text=request.text,\n            image=request.image\n        )\n        \n        return FrameRenderResponse(\n            frame_path=frame_path,\n            width=width,\n            height=height\n        )\n        \n    except Exception as e:\n        logger.error(f\"Frame render error: {e}\")\n        raise HTTPException(status_code=500, detail=str(e))\n\n\n@router.get(\"/template/params\", response_model=TemplateParamsResponse)\nasync def get_template_params(\n    template: str\n):\n    \"\"\"\n    Get custom parameters for a template\n    \n    Returns the custom parameters defined in the template HTML file.\n    These parameters can be passed via `template_params` in video generation requests.\n    \n    Template parameters are defined using syntax: `{{param_name:type=default}}`\n    \n    Supported types:\n    - `text`: String input\n    - `number`: Numeric input\n    - `color`: Color picker (hex format)","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/api/routers/frame.py#L65-L101","documentation":"The frame render endpoint wraps template rendering in a broad except that converts any exception into HTTP 500 with str(e) as detail. Any unhandled failure in rendering — unknown template name, bad parameters, media/asset loading errors — surfaces as this opaque 500.","triggerScenarios":"POST to the frame render endpoint when the renderer raises: template file missing or unparseable, invalid width/height or template params, missing media asset referenced by the template, or an internal error in the rendering library.","commonSituations":"Misspelled template name passed in the request; template params not matching the template schema after an update; referenced media file absent from output/; renderer dependency upgraded with breaking changes.","solutions":["Check the server log 'Frame render error: ...' for the underlying exception.","Validate the template name via the /template/params endpoint before rendering.","Confirm all template parameters and media paths in the request are correct and files exist.","Retry if the log indicates a transient IO/network issue.","Log the traceback server-side and return a generic 500 detail to clients."],"exampleFix":"// before\nexcept Exception as e:\n    logger.error(f\"Frame render error: {e}\")\n    raise HTTPException(status_code=500, detail=str(e))\n// after\nexcept Exception:\n    logger.exception(\"Frame render error\")\n    raise HTTPException(status_code=500, detail=\"Frame render failed\")","handlingStrategy":"validation","validationCode":"const paramsRes = await fetch(`/api/frame/template/params?template=${encodeURIComponent(template)}`);\nif (!paramsRes.ok) throw new Error(`Template ${template} is not available (status ${paramsRes.status})`);\nconst params = await paramsRes.json();\n// validate render request width/height and required params against `params` before calling render","typeGuard":null,"tryCatchPattern":"try {\n  const res = await fetch('/api/frame/render', { method: 'POST', headers: {'Content-Type':'application/json'}, body: JSON.stringify(renderRequest) });\n  if (!res.ok) throw new Error(`Frame render failed (${res.status}): ${(await res.json()).detail}`);\n  return await res.json();\n} catch (err) {\n  logger.error('Frame render request failed', err);\n  throw err;\n}","preventionTips":["Validate the template name via /template/params before rendering.","Ensure all media assets referenced by the request already exist under output/.","Keep template params in sync with the template schema after upgrades.","Retry only transient failures identified from server logs."],"tags":["http-500","rendering","api","generic-error"],"backgroundTag":"internal-server-error-500","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}