mirror of
https://github.com/Dasemu/remote-mcp-manager.git
synced 2026-11-26 23:36:31 +00:00
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>
10 lines
576 B
TypeScript
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;
|
|
}
|