Copied!

Holds information about an error or notice that happened on a specific object.

CloneableInstantiable
Methods
public __construct(string $message, string $psrLogLevelAsErrorLevel, ZBateson\MailMimeParser\ErrorBag $object, ?Throwable $exception = NULL)
 
  • throws \InvalidArgumentException if the passed $psrLogLevelAsErrorLevel is not a known PSR log level (see \Psr\Log\LogLevel)
public getClass() : string
 

Returns the class type the error occurred on.

public getException() : ?Throwable
 

Returns the exception that occurred, if any, or null.

public getMessage() : string
 

Returns the error message.

public getObject() : ZBateson\MailMimeParser\ErrorBag
 

Returns the object the error occurred on.

public getPsrLevel() : string
 

Returns the PSR string log level for this error message.

public isPsrLevelGreaterOrEqualTo(string $minLevel) : bool
 

Returns true if the PSR log level for this error is equal to or greater than the one passed, e.g. passing LogLevel::ERROR would return true for LogLevel::ERROR and LogLevel::CRITICAL, ALERT and EMERGENCY.

Properties
protected ?Throwable $exception
 
  • var ?\Throwable An Exception object if one happened, or null if not
protected string $message
 
  • var string The error message.
protected ZBateson\MailMimeParser\ErrorBag $object
 
  • var \ErrorBag The object the error/notice occurred on.
protected string $psrLevel
 
  • var string The PSR log level for this error.
Properties
private array $levelMap = ['emergency' => 0, 'alert' => 1, 'critical' => 2, 'error' => 3, 'warning' => 4, 'notice' => 5, 'info' => 6, 'debug' => 7]
 
  • var array<string,int>
© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration