All errors in podman-ts extend eitherDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Pratyay360/podman-ts/llms.txt
Use this file to discover all available pages before exploring further.
PodmanError or APIError. This consistent hierarchy means you can catch broad categories with a single instanceof check, or target specific failure modes with more precise classes.
Error hierarchy
PodmanError is the base class for every error the SDK raises. Catching it covers all SDK-level failures, though in practice you will usually want to handle APIError and its subclasses more specifically.
Catching errors
Useinstanceof checks to distinguish error types. Ordering matters: check more specific classes before more general ones.
APIError properties
APIError wraps HTTP error responses (status codes 400 and above). It extends PodmanError and adds:
| Property / Method | Type | Description |
|---|---|---|
statusCode | number | undefined | The HTTP status code returned by Podman. |
explanation | string | undefined | Additional context from the response body, when available. |
isClientError() | () => boolean | Returns true for 4xx status codes. |
isServerError() | () => boolean | Returns true for 5xx status codes. |
toString() | () => string | Formatted string like "404 Client Error: not found (image not found)". |
ContainerError
ContainerError is thrown by client.containers.run() when the container process exits with a non-zero status code. It extends PodmanError directly (not APIError) and carries the exit code.
| Property | Type | Description |
|---|---|---|
exitStatus | number | The exit code of the container process. |
ContainerError is only raised by containers.run(). When you use container.wait() directly, you receive the exit code as a return value rather than an exception.BuildError
BuildError is thrown by client.images.build() when a build fails. It extends PodmanError and includes the full build log so you can surface the failure context.
| Property | Type | Description |
|---|---|---|
buildLog | string[] | Lines of build output captured before the failure. |
Frequently asked questions
What is the difference between NotFound and ImageNotFound?
What is the difference between NotFound and ImageNotFound?
Both map to HTTP 404 responses.
ImageNotFound is used specifically when an image lookup fails (for example, client.images.get()), so you can distinguish a missing image from other missing resources (containers, networks, volumes) that raise NotFound instead.When is InvalidArgument raised?
When is InvalidArgument raised?
InvalidArgument is thrown when input validation fails before a request is sent — for example, when a required field is missing or a parameter has an invalid value. It extends PodmanError directly and has no statusCode.When is StreamParseError raised?
When is StreamParseError raised?
StreamParseError wraps failures that occur while parsing a JSON stream from the Podman service — for example, during client.events.list() or streaming container logs with decode: true. It contains the underlying parse error as a string in its message.How do I handle timeout errors?
How do I handle timeout errors?
When a
timeout is set on the client, timed-out requests throw a browser-native DOMException with name: "TimeoutError". These are not wrapped into a PodmanError subclass, so check for them separately: