Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

ServerException.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\REST\Client\Exceptions;
8
9 use eZ\Publish\Core\REST\Client\Values\ErrorMessage;
10 use Exception;
11
17 class ServerException extends Exception
18 {
19 protected $trace;
20
24 public function __construct(ErrorMessage $error)
25 {
26 // Use description, this is the exception message from sever, message is only the HTTP status message.
27 parent::__construct($error->description, $error->code);
28
29 // These are only set if server is running in debug mode, but even if not set we want to overwrite the values.
30 $this->file = (string)$error->file;
31 $this->line = (int)$error->line;
32 $this->trace = explode("\n", (string)$error->trace);
33 }
34 }
eZ\Publish\Core\REST\Client\Exceptions\ServerException
Wraps a eZ\Publish\Core\REST\Client\Values\ErrorMessage to provide info from server.
Definition: ServerException.php:18
eZ\Publish\Core\REST\Client\Exceptions\ServerException\__construct
__construct(ErrorMessage $error)
Definition: ServerException.php:24
eZ\Publish\Core\REST\Client\Exceptions\ServerException\$trace
$trace
Definition: ServerException.php:19
eZ\Publish\Core\REST\Client\Values\ErrorMessage
Definition: Values/ErrorMessage.php:20
eZ\Publish\Core\REST\Client\Exceptions
Definition: Core/REST/Client/Exceptions/BadStateException.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.