Blamite Game Engine - Blam (Core)
Blam::Error Namespace Reference

Namespace containing things relating to Error information and reporting. More...

Enumerations

enum  ErrorDisplayType { Log, Dialog, MessageBox }
 Enumerator used to control how error info from Blam::Error::ShowLastErrorInfo is displayed. More...
 

Functions

BLAM void ShowLastErrorInfo (const char *function, ErrorDisplayType display_type)
 Displays the last error information from Windows. More...
 
BLAM int ShowErrorDialog (std::string message, HRESULT hr, bool allow_continue, bool allow_safemode)
 Shows an Error dialog with the specified error details and result handle. More...
 
BLAM std::string GetStringFromHResult (HRESULT hr)
 Converts a result handle to a string. More...
 

Detailed Description

Namespace containing things relating to Error information and reporting.

Enumeration Type Documentation

◆ ErrorDisplayType

Enumerator used to control how error info from Blam::Error::ShowLastErrorInfo is displayed.

Enumerator
Log 

Writes the error to the game log.

Dialog 

Shows an engine Error dialog.

MessageBox 

Shows a generic message box.

Function Documentation

◆ GetStringFromHResult()

std::string Blam::Error::GetStringFromHResult ( HRESULT  hr)

Converts a result handle to a string.

Parameters
hr- The error code to convert.
Todo:
Move this to Blam::Converters

◆ ShowErrorDialog()

int Blam::Error::ShowErrorDialog ( std::string  message,
HRESULT  hr,
bool  allow_continue,
bool  allow_safemode 
)

Shows an Error dialog with the specified error details and result handle.

This can be used to show a more descriptive message along with an error code for debugging.

Parameters
message- The detailed message to show.
hr- The result handle that was in an error state.
allow_continue- Whether or not to allow the user to try to continue.
allow_safemoed- Whether or not to allow the user to try to continue in Safe Mode.

◆ ShowLastErrorInfo()

void Blam::Error::ShowLastErrorInfo ( const char *  function,
ErrorDisplayType  display_type 
)

Displays the last error information from Windows.

Parameters
function- The function that was last called, ex: TEXT("LoadCursorW")
display_type- The error display type. See Blam::Error::ErrorDisplayType for details.