jamiepine/voicebox · error · HTTPException
{exception message from update_preset (ValueError)}
Error message
{exception message from update_preset (ValueError)} What it means
HTTP 400 raised by PUT /effects/presets/{preset_id} when effects_mod.update_preset() raises ValueError. The service raises ValueError in two cases: the preset is built-in (is_builtin true -> 'Cannot modify built-in presets'), or the supplied effects_chain fails validate_effects_chain() (unknown type/out-of-range param, message passed through). The handler re-wraps the message into 400.
Source
Thrown at backend/routes/effects.py:122
raise HTTPException(status_code=400, detail=str(e))
@router.put("/effects/presets/{preset_id}", response_model=models.EffectPresetResponse)
async def update_effect_preset(
preset_id: str,
data: models.EffectPresetUpdate,
db: Session = Depends(get_db),
):
"""Update an effect preset."""
from ..services import effects as effects_mod
try:
result = effects_mod.update_preset(preset_id, data, db)
if not result:
raise HTTPException(status_code=404, detail="Preset not found")
return result
except ValueError as e:
raise HTTPException(status_code=400, detail=str(e))
@router.delete("/effects/presets/{preset_id}")
async def delete_effect_preset(preset_id: str, db: Session = Depends(get_db)):
"""Delete a user effect preset."""
from ..services import effects as effects_mod
try:
if not effects_mod.delete_preset(preset_id, db):
raise HTTPException(status_code=404, detail="Preset not found")
return {"status": "deleted"}
except ValueError as e:
raise HTTPException(status_code=400, detail=str(e))
@router.get(
"/generations/{generation_id}/versions",
response_model=list[models.GenerationVersionResponse],View on GitHub (pinned to 51f49dea19)
Solutions
- If the detail is 'Cannot modify built-in presets', target a user-created preset or create a new one.
- If the detail is a chain-validation message, fix the named effect/param per the validator.
- Disable edit controls for presets where is_builtin is true.
- Validate the chain client-side with the same rules before submitting.
Example fix
// before
await fetch(`/effects/presets/${id}`, { method:'PUT', body: JSON.stringify({ effects_chain }) });
// after
if (preset.is_builtin) { alert('Duplicate the built-in preset to edit it'); return; }
await fetch(`/effects/presets/${id}`, { method:'PUT', body: JSON.stringify({ effects_chain }) }); Defensive patterns
Strategy: validation
Validate before calling
if (preset.is_builtin) throw new Error('cannot modify built-in preset');
// plus run the same chain validation as error 94 Type guard
function isBuiltinPreset(p): p is { is_builtin: true } { return p?.is_builtin === true; } Try / catch
const r = await fetch(`/effects/presets/${id}`, { method:'PUT', body: JSON.stringify(patch) });
if (r.status === 400) { const { detail } = await r.json(); /* 'Cannot modify built-in presets' or chain error */ } Prevention
- Disable editing for presets where is_builtin is true.
- Duplicate a built-in preset to a user preset to customize it.
- Validate the chain client-side before submitting.
When it happens
Trigger: PUTting to a built-in preset, or supplying an effects_chain that violates the validator rules.
Common situations: Editing a shipped built-in preset instead of a user one; sending a chain with a typo'd effect name or out-of-range param; UI not disabling edit for built-ins.
Related errors
- {exception message from create_preset (ValueError)}
- {exception message from update_channel (ValueError)}
- {exception message from delete_channel (ValueError)}
- Generation is not completed
- {validation error from validate_effects_chain}
AI-assisted analysis of jamiepine/voicebox@51f49dea19 (2026-08-12).
Data as JSON: /api/errors/a1cc1220b7e04590.
Report an issue: GitHub.