Errors

Every error fmsave raises on purpose is a FmsaveError; every warning it issues on purpose is a FmsaveWarning. GateCheckError is the one exception that is also more specific than its base: it is the ReaderCheckError a save opened with strict=True raises for a failed check.

exception fmsave.FmsaveError[source]

Bases: Exception

Base class for every error fmsave raises on purpose.

exception fmsave.NotAFmSaveError[source]

Bases: FmsaveError

The file is not a Football Manager save.

exception fmsave.CorruptSaveError[source]

Bases: FmsaveError

The save is damaged, truncated, or was being written while it was read.

exception fmsave.UnsupportedGameError[source]

Bases: FmsaveError

The save comes from a Football Manager version fmsave cannot read.

exception fmsave.ReaderCheckError[source]

Bases: FmsaveError

A reader’s checks failed, so its output would not be trustworthy.

exception fmsave.GateCheckError(message, checks=())[source]

Bases: ReaderCheckError

A ReaderCheckError from failed reader checks, carrying every check of the failed pass.

This is what fmsave.open(…, strict=True) raises when an applied check misses its bounds. Catching ReaderCheckError catches it, and checks holds the gate names, the observed values and the bounds the message rounds, so nothing has to be parsed back out of the text. A ReaderCheckError raised for any other reason carries no checks.

Parameters:
Return type:

None

checks

Every reader of the failed pass, each with its own gates.

Type:

tuple[fmsave._checks.ReaderCheck, …]

exception fmsave.SaveChangedError[source]

Bases: FmsaveError

The save file changed on disk after it was opened.

exception fmsave.SaveClosedError[source]

Bases: FmsaveError

A reader was called on a closed save.

exception fmsave.AmbiguousNameError[source]

Bases: FmsaveError

A name matched more than one record where exactly one was needed.

exception fmsave.FmsaveWarning[source]

Bases: UserWarning

Base class for every warning fmsave issues on purpose.

exception fmsave.UnknownBuildWarning[source]

Bases: FmsaveWarning

The save comes from an FM26 build fmsave has no layout tables for.

exception fmsave.ReaderCheckWarning[source]

Bases: FmsaveWarning

A reader’s measured checks failed and it handed its table back anyway.

This is what a failed check does on a save opened without strict=True. The message is the one ReaderCheckError carries on a strict save. A structural failure, where the decode has no table to hand back at all, raises ReaderCheckError whatever the setting.