Skip to content

API Errors

Alexandre 'kidev' Poumaroux edited this page Oct 21, 2026 · 4 revisions

Errors

Import from proleak import errors

Exceptions raised by the ProLeak API.

Exceptions

Exception
ProLeakError Base class of ProLeak API errors.
ReadOnlyField The field cannot be written (not editable, or a post handler).
NotCancellable The event cannot be cancelled (not cancellable, or a post handler).
FieldTypeError The value has the wrong type or range for the field.
EventExpired The event was used after its dispatch ended.
NotAllowedHere The current server kind does not allow this capability.
UnknownEvent No event has this name.
EventUnavailable The event exists but its game hook did not resolve on this game version.
FeatureUnavailable A ProLeak feature is off on this game version: what it uses changed in the game.
ActionUnavailable The player action's game calls changed on this game version.
AdvancedUnavailable The game type an advanced call names changed on this game version.
PostOnlyEvent The event is raised after the game acts only; it has no pre=True phase.
WrongThread This API must be called from the game's main thread.
BlockingCallOnMainThread A blocking call was made from a main-thread handler.
PluginTimeout Raised into a handler that ran past its budget.
ModeError A game mode cannot start; the message says why.
UnitGone The unit died, or its id now belongs to another unit.
PluginUnloaded Raised into a plugin's worker threads when the plugin unloads.

Functions

Returns Function
Iterator[None] mapped() A with block in which an exception from the game's .NET side becomes the matching ProLeak one.

Function documentation

mapped

mapped() -> Iterator[None]

A with block in which an exception from the game's .NET side becomes the matching ProLeak one.

Wrap direct calls into game classes from type in it.

ProLeakError class

Base class of ProLeak API errors.

Inherits Exception.

ReadOnlyField class

The field cannot be written (not editable, or a post handler).

Inherits ProLeakError, AttributeError.

NotCancellable class

The event cannot be cancelled (not cancellable, or a post handler).

Inherits ProLeakError.

FieldTypeError class

The value has the wrong type or range for the field.

Inherits ProLeakError, TypeError.

EventExpired class

The event was used after its dispatch ended. Keep values, not events.

Inherits ProLeakError.

NotAllowedHere class

The current server kind does not allow this capability.

Inherits ProLeakError, PermissionError.

UnknownEvent class

No event has this name.

Inherits ProLeakError, LookupError.

EventUnavailable class

The event exists but its game hook did not resolve on this game version.

Inherits ProLeakError.

FeatureUnavailable class

A ProLeak feature is off on this game version: what it uses changed in the game.

Inherits ProLeakError.

Detailed description

The player can run it anyway from Mods > Advanced > Game version.

ActionUnavailable class

The player action's game calls changed on this game version.

Inherits FeatureUnavailable.

AdvancedUnavailable class

The game type an advanced call names changed on this game version.

Inherits FeatureUnavailable.

PostOnlyEvent class

The event is raised after the game acts only; it has no pre=True phase.

Inherits ProLeakError, ValueError.

WrongThread class

This API must be called from the game's main thread.

Inherits ProLeakError, RuntimeError.

BlockingCallOnMainThread class

A blocking call was made from a main-thread handler. Use proleak.tasks.

Inherits ProLeakError, RuntimeError.

PluginTimeout class

Raised into a handler that ran past its budget.

Inherits BaseException.

Detailed description

Derives from BaseException so except Exception cannot swallow it.

ModeError class

A game mode cannot start; the message says why.

Inherits ProLeakError.

UnitGone class

The unit died, or its id now belongs to another unit. Ask world.unit(id) again.

Inherits ProLeakError.

PluginUnloaded class

Raised into a plugin's worker threads when the plugin unloads.

Inherits BaseException.


Previous: Cosmetics | Next: Game data

Clone this wiki locally