OpenTTD Source 20260108-master-g8ba1860eaa
saveload_error.hpp File Reference

Functions/types related to errors from savegames. More...

#include "../3rdparty/fmt/format.h"
#include "../strings_type.h"

Go to the source code of this file.

Functions

void SlError (StringID string, const std::string &extra_msg={})
 Error handler.
 
void SlErrorCorrupt (const std::string &msg)
 Error handler for corrupt savegames.
 
template<typename ... Args>
void SlErrorCorruptFmt (const fmt::format_string< Args... > format, Args &&... fmt_args)
 Issue an SlErrorCorrupt with a format string.
 

Detailed Description

Functions/types related to errors from savegames.

Definition in file saveload_error.hpp.

Function Documentation

◆ SlError()

void SlError ( StringID  string,
const std::string &  extra_msg 
)

◆ SlErrorCorrupt()

◆ SlErrorCorruptFmt()

template<typename ... Args>
void SlErrorCorruptFmt ( const fmt::format_string< Args... >  format,
Args &&...  fmt_args 
)
inline

Issue an SlErrorCorrupt with a format string.

Parameters
format_stringThe formatting string to tell what to do with the remaining arguments.
fmt_argsThe arguments to be passed to fmt.
Template Parameters
ArgsThe types of the fmt arguments.
Note
This function does never return as it throws an exception to break out of all the saveload code.

Definition at line 28 of file saveload_error.hpp.

References SlErrorCorrupt().

Referenced by SlAutolength(), SlIterateArray(), SlLoadCheckChunk(), and SlLoadChunk().