ClassGo

Exception

Synopsis

Description

Exception is PHP's base exception class; the SPL exception and Error classes are the same Go type carrying a different class name and a catch clause filters on the name and not on a subclass relation.

Exception is a class phpscript declares.

$object = new Exception($string, $num, $value);

Properties

public string $message

The go field Message.

public int $code

The go field Code.

public string $class

The go field Class.

Methods

public function get_code(): int

get_code returns the code.

The go method GetCode.

public function get_file(): string

get_file returns the file the throwable was created in.

The go method GetFile.

public function get_line(): int

get_line returns the line the throwable was created on.

The go method GetLine.

public function get_message(): string

get_message returns the message.

The go method GetMessage.

public function get_previous(): mixed

get_previous returns the exception this one wraps, or null.

The go method GetPrevious.

public function get_trace(): array

get_trace returns the call trace, always empty here.

The go method GetTrace.

public function get_trace_as_string(): string

get_trace_as_string returns the trace in php's text form, which is the bare entry of an empty one.

The go method GetTraceAsString.

public function throwable_class(): string

throwable_class names the class a catch clause filters on.

The go method ThrowableClass.

Binding

Go type
github.com/titpetric/phpx/stdlib/px/phpx.Throwablegodoc
Package
github.com/titpetric/phpx/stdlib/px/phpxgodoc
Satisfies
Throwablegodoc

See also