The StreamException class

Introduction

A StreamException is thrown when a stream operation reports a terminating error and the error_mode stream context option is set to StreamErrorMode::Exception.

The exception message is the message of the first error of the operation. All errors of the operation are available from StreamException::getErrors.

Note: The exception code is an internal number that may change between PHP versions. To identify the error, use the code property of the errors returned by StreamException::getErrors.

Class synopsis

StreamException
extends Exception
/* Inherited properties */
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private Throwablenull $previous = null;
/* Methods */
public array StreamException::getErrors()
/* Inherited methods */
public __construct(string $message = "", int $code = 0, Throwablenull $previous = null)
final public string getMessage()
final public Throwablenull getPrevious()
final public int getCode()
final public string getFile()
final public int getLine()
final public array getTrace()
final public string getTraceAsString()
public string __toString()
private void __clone()

See Also

Table of Contents