PHP Classes

File: docs/classes/TError.md

Recommend this page to a friend!
  Classes of ASCOOS CMS   Ascoos Framework   docs/classes/TError.md   Download  
File: docs/classes/TError.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: Ascoos Framework
Framework of general purposes classes
Author: By
Last change: 24.0.6
Date: 2 months ago
Size: 1,573 bytes
 

Contents

Class file image Download

Class TError

*Implements the error management class.*

>### Extends Error

Use:

use ASCOOS\FRAMEWORK\Kernel\Core\TError;

throw new TError("Message");

// OR

try {
    echo "Run Ascoos Framework";
} catch (TError $e) {
    echo 'Caught exception: ',  $e->getMessage(), "\n";
    $e->Free($e);
}


try {
    throw new TError("Some error message");
} catch(TError $e) {
    echo $e->getError(AFW_ERROR_ARGUMENT_INVALID_TYPE); // ??? ??????? ????????? ??????. ??????? ??? ?? ???? ???? ??????? ?????? $_ERRORS
} finally {
    if (is_object($e)) $e->Free($e);
}

Methods

  • `__construct(string $message = "", int $code = 0, ?Throwable $previous = null)` : Initialize the class.
  • `string __toString()` : Returns a string containing the error.
  • `bool Free(object $object)` : Frees the memory of the Object or its clone
  • `bool FreeProperties(object $object): bool` : Delete and Frees up memory for all class properties.

*

<details> <summary>? INHERITANCES </summary>

  • `PROPERTIES` * protected string $message = ""; * protected int $code; * protected string $file = ""; * protected int $line;
  • `METHODS` * final public getMessage(): string * final public getPrevious(): ?Throwable * final public getCode(): int * final public getFile(): string * final public getLine(): int * final public getTrace(): array * final public getTraceAsString(): string

</details>