bsdkrun/error
The single error type returned by every fallible function in the SDK.
Types
Why a call failed.
BinaryNotFound— thebsdkrunbinary could not be located; carries every path that was searched.CommandFailed— absdkruninvocation exited non-zero; carries the exit code, both captured streams, and a label naming the command.SandboxNotFound— no machine matched the given id or prefix.DecodeFailed—bsdkrun --jsonproduced output the SDK could not decode; carries the raw text.InvalidOptions— the create options were internally inconsistent, e.g. a required field left empty.GraphqlError— talking to a remotebsdkrundthroughbsdkrun/clientfailed: a resolver returned a GraphQL error, the response could not be parsed, or the daemon could not be reached at all.codecarries the GraphQLextensions.codethe daemon sent, when there was one.AuthError— the daemon rejected the bearer token: an HTTP 401, a GraphQL error whoseextensions.codeis"UNAUTHENTICATED", or a subscription socket that closed beforeconnection_ackever arrived.
The last two are only ever produced by bsdkrun/client (the remote
GraphQL client added alongside the local, CLI-shelling API this type was
originally written for) — every other function in this SDK only produces
the first five.
pub type Error {
BinaryNotFound(searched: List(String))
CommandFailed(
exit_code: Int,
stdout: String,
stderr: String,
label: String,
)
SandboxNotFound(id: String)
DecodeFailed(label: String, raw: String)
InvalidOptions(message: String)
GraphqlError(message: String, code: option.Option(String))
AuthError(message: String)
}
Constructors
-
BinaryNotFound(searched: List(String)) -
CommandFailed( exit_code: Int, stdout: String, stderr: String, label: String, ) -
SandboxNotFound(id: String) -
DecodeFailed(label: String, raw: String) -
InvalidOptions(message: String) -
GraphqlError(message: String, code: option.Option(String)) -
AuthError(message: String)