S&box Wiki

Sandbox.Log.Error

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

Special Pages


Wikis

?

Render Time: 61ms

DB GetPage 48
Generate Html 0
SaveChanges (1) 8
Render Body 0
Render Sidebar 2