Table of Contents

Namespace Gym.Exceptions

Classes

AlreadyPendingCallError

An asynchronous reset or step was started while the previous one of the same kind is still pending. Not an Error, as in Gymnasium.

AlreadySteppingError

0.2's "already running an async step" error, kept so 0.2 code that catches it still compiles (DR-58). It is AlreadyPendingCallError's base class, so catch (AlreadySteppingError) catches AsyncVectorEnv's error for a call started while another is pending, the same situation.

ClosedEnvironmentError

reset or step on an environment that was closed.

CustomSpaceError

A custom space that AsyncVectorEnv with shared memory cannot place in shared memory.

DependencyNotInstalled

An optional dependency an env needs is missing.

DeprecatedEnv

The requested version is older than the latest one of the same name.

DeprecatedWrapper

Raised when importing an old version of a wrapper. It is an ImportError, not an Error, as in Gymnasium: catch (Error) does not catch it.

Error

The superclass of every error Gym.NET raises itself (as opposed to Python built-ins such as ValueError, which Gym.NET takes from NumSharp, decision D17). Catch it to handle any library-defined failure, for example an invalid seed.

InvalidAction

An action outside the action space. The envs mostly assert instead (AssertionError), as Gymnasium's do; CarRacing raises this one, as should a custom env refusing an action.

InvalidActionError

0.2's invalid-action error, kept so 0.2 code that catches or throws it still compiles (DR-58). It is InvalidAction's base class, so catch (InvalidActionError) catches what CarRacing and custom envs raise for an action outside their space.

InvalidBound

Clipping or rescaling with an invalid lower and/or upper bound.

InvalidMetadata

An env's metadata is not valid (for example render_fps missing where needed).

InvalidProbability

A probability outside [0, 1] (for example StickyAction's).

MissingArgument

A required constructor argument was not given.

NameNotFound

No env of the id's name exists (in its namespace).

NamespaceNotFound

The id's namespace (ns/Name-v0) is not registered.

NoAsyncCallError

reset_wait or step_wait was called with no matching asynchronous call running.

NotSteppingError

0.2's "not running an async step" error, kept so 0.2 code that catches it still compiles (DR-58). It is NoAsyncCallError's base class, so catch (NotSteppingError) catches AsyncVectorEnv's error for a _wait without its _async, the same situation.

RegistrationError

An invalid registration, such as an unversioned id next to versioned ones.

ResetNeeded

step or render was called before the first reset, which OrderEnforcing<TObs, TAct> enforces.

UnregisteredEnv

The registry has no env for the requested id. Catch it to handle any of its three precise causes (NamespaceNotFound, NameNotFound, VersionNotFound).

UnsupportedMode

A render mode the env does not support was requested.

VersionNotFound

The name exists, but not in the requested version.