Blamite Game Engine - blam!  00272.10.26.20.0001.blamite
The core library for the Blamite Game Engine.
Blam::Error Namespace Reference

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

Functions

BLAM void ShowLastErrorInfo (const char *function, BlamErrorDisplayType 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.

@info This namespace does not contain anything relating to error codes. Error code functions can be found in Blam::Diagnostics::Errors. Over time, the stuff in here should be moved to that namespace instead.

Function Documentation

◆ GetStringFromHResult()

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

Converts a result handle to a string.

Parameters
hr- The error code to convert.
Deprecated:
We should start moving away from HRESULTs in favor of our own error code system, as to not become reliant on Windows-exclusive code.

◆ 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,
BlamErrorDisplayType  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 BlamErrorDisplayType for details.