Skip to content

Engine → Scripting

scripting_error.h

Error codes of the scripting module. Built with the generic core::make_error(scripting_error::X, detail) and bound to the "scripting" category below. The codes start at 1 so the negated value the native table entries return (-code, native_api.inl) is never 0.

Enumerations

scripting_error

enum class scripting_error : u16 {
    RUNTIME_NOT_FOUND = 1,      // hostfxr could not be located: no .NET runtime installed
    HOSTFXR_INCOMPATIBLE,       // hostfxr lacks a required export or delegate: older than .NET 10
    RUNTIME_CONFIG_INVALID,     // Conjure.Bootstrap.runtimeconfig.json missing or malformed
    MANAGED_SDK_MISSING,        // Conjure.Managed.dll / Conjure.Bootstrap.dll not in managed_directory
    HOST_ALREADY_RUNNING,       // a runtime of another mode already lives in this process
    ABI_MISMATCH,               // size, version or layout hash of a table differs between the sides
    ASSEMBLY_LOAD_FAILED,       // the game assembly did not load; the previous one keeps running
    ASSEMBLY_LEAKED,            // the collectible load context survived unload (zombie)
    CLASS_NOT_FOUND,            // no script class with this hash in the active registry
    FIELD_NOT_FOUND,            // the class has no field with this hash
    FIELD_BLOB_INVALID,         // a field blob failed validation (magic, version, bounds)
    INSTANCE_NOT_FOUND,         // the entry or slot does not resolve to a live instance
    WRONG_THREAD,               // called off the main thread
    NOT_IN_PHASE,               // a query scope was requested outside a script phase
    BUILD_FAILED,               // dotnet build reported errors
    NOT_INITIALISED,            // the host or runtime is not READY
    NOT_SUPPORTED,              // the entry or feature is not available in this configuration
    COUNT
};

Macros

CONJURE_DECLARE_ERROR_CATEGORY

CONJURE_DECLARE_ERROR_CATEGORY( conjure::scripting::scripting_error, "scripting", conjure::scripting::scripting_error_name )

Functions

Public

scripting_error_name

[[nodiscard]] CONJURE_API std::string_view scripting_error_name(
    scripting_error code) noexcept;

The enumerator name of a code ("ABI_MISMATCH"); "" for unknown values.

status_of

[[nodiscard]] constexpr i32 status_of(
    scripting_error code) noexcept;

The negative status a native table entry returns for this error (-code).