Files
ersatztv/ErsatzTV.Core/Errors/LockedError.cs
T
timothyandClaude Opus 4.8 ec26e1be5b fix(api): #316 review — POST-ify graphics-elements refresh, LockedError→409, no-store machine-key
- GET /api/graphics-elements no longer side-effects; refresh moved to
  POST /api/graphics-elements/refresh (204), closing a CSRF vector on a GET.
- PrepareTroubleshootingPlaybackHandler now returns a typed LockedError from
  both atomic lock-acquire failures; ApiResults.ToErrorResult maps it to 409
  instead of falling through to 422, so a lock lost in the race between the
  controller's pre-check and the handler's atomic acquire still reports 409.
- AuthController.MachineKey sets Cache-Control: no-store + Pragma: no-cache
  on the 200 response carrying the master API key.
- Reworded the stale "subtitleId query parameter" endpoint description now
  that playback/start takes a JSON body.
- Regenerated openapi/v1.json + docs/endpoint-index.md; docs/api-conventions.md
  updated with the LockedError pattern (§3a) and the ToErrorResult table row.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 21:50:42 +02:00

14 lines
482 B
C#

namespace ErsatzTV.Core.Errors;
/// <summary>
/// A <see cref="BaseError" /> raised when a mutation races another operation that already holds an
/// exclusive lock (e.g. a troubleshooting playback session in flight). REST endpoints map this to
/// HTTP 409 Conflict, distinguishing it from the generic 422 other <see cref="BaseError" /> values get.
/// </summary>
public class LockedError : BaseError
{
public LockedError(string value) : base(value)
{
}
}