S&box Wiki

Sandbox.Log.Error

Syntax

static void Error( System.Exception exception )

Description

Throws an error message to the console and an in-game notification.

Arguments

System.Exception exception

Example

Throws an error with a generic exception.

Log.Error( new Exception() );
Output:
Exception of type 'System.Exception' was thrown.
generic_exception.png

Example

Throws a generic exception with a custom message.

Log.Error( new Exception( "Custom exception message" ) );
Output:
Custom exception message
generic_exception_custom.png