package fehu

  1. Overview
  2. Docs

Module Fehu.ErrorsSource

Error types and exception handling for environments.

Error types for the Fehu reinforcement learning framework.

This module defines the error hierarchy for environment operations, validation, and registration. All framework-specific errors use the Error exception with structured error variants for precise error handling.

Sourcetype t =
  1. | Unregistered_env of string
    (*

    Environment ID not found in registry

    *)
  2. | Namespace_not_found of string
    (*

    Environment namespace doesn't exist

    *)
  3. | Name_not_found of string
    (*

    Environment name not found in namespace

    *)
  4. | Version_not_found of string
    (*

    Environment version not available

    *)
  5. | Deprecated_env of string
    (*

    Environment is deprecated

    *)
  6. | Registration_error of string
    (*

    Environment registration failed

    *)
  7. | Dependency_not_installed of string
    (*

    Required dependency missing

    *)
  8. | Unsupported_mode of string
    (*

    Requested mode not supported

    *)
  9. | Invalid_metadata of string
    (*

    Metadata validation failed

    *)
  10. | Reset_needed of string
    (*

    Environment requires reset before step

    *)
  11. | Invalid_action of string
    (*

    Action outside valid space

    *)
  12. | Missing_argument of string
    (*

    Required argument not provided

    *)
  13. | Invalid_probability of string
    (*

    Probability value out of 0, 1 range

    *)
  14. | Invalid_bound of string
    (*

    Bound constraint violated

    *)
  15. | Closed_environment of string
    (*

    Operation on closed environment

    *)

Error variants covering framework operations.

Each variant includes a descriptive message for debugging.

Sourceexception Error of t

Framework exception wrapping structured error types.

Sourceval to_string : t -> string

to_string error converts error to a human-readable message.

Use for logging, error reporting, or user-facing diagnostics.

Sourceval raise_error : t -> 'a

raise_error error raises the framework exception with error.

Equivalent to raise (Error error).