OpenGSQ PHP

InvalidPacketException extends Exception
in package

Class InvalidPacketException

Represents errors that occur during application execution when a packet is invalid.

Table of Contents

Methods

__construct()  : mixed
Initializes a new instance of the InvalidPacketException class with a specified error message.
throwIfNotEqual()  : void
Checks if the received value is equal to the expected value.
getCustomMessage()  : string
Generates a custom error message for packet header mismatches.

Methods

__construct()

Initializes a new instance of the InvalidPacketException class with a specified error message.

public __construct(string $message) : mixed
Parameters
$message : string

The message that describes the error.

throwIfNotEqual()

Checks if the received value is equal to the expected value.

public static throwIfNotEqual(mixed $received, mixed $expected) : void
Parameters
$received : mixed

The received value.

$expected : mixed

The expected value.

Tags
throws
InvalidPacketException

Thrown when the received value does not match the expected value.

getCustomMessage()

Generates a custom error message for packet header mismatches.

private static getCustomMessage(mixed $received, mixed $expected) : string
Parameters
$received : mixed

The received value.

$expected : mixed

The expected value.

Return values
string

The custom error message.


        
On this page

Search results