Files
remote-mcp-manager/apps/server/src/docker/errors.ts
T
dasemuandClaude Sonnet 5.5 a999b8c694 feat: add start/stop/restart controls and explain build vs deploy in the panel
Start/stop/restart act on the existing container instead of recreating it.
Docker's 304 (already started/stopped) is treated as success.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-19 05:26:22 +02:00

10 lines
576 B
TypeScript

/** True when a dockerode call failed because the target container (or image) doesn't exist. */
export function isNotFoundError(err: unknown): boolean {
return typeof err === "object" && err !== null && (err as { statusCode?: unknown }).statusCode === 404;
}
/** True for HTTP 304: docker-modem surfaces "already started/stopped" as an error, but it means the container is already in the wanted state. */
export function isNotModifiedError(err: unknown): boolean {
return typeof err === "object" && err !== null && (err as { statusCode?: unknown }).statusCode === 304;
}