Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
LocalizedException Class Reference
Inheritance diagram for LocalizedException:
SubscriptionUpdateException Exception IndexTableNotExistException UnknownStateException Exception Exception BackupException ValidationSchemaException AbstractAggregateException AlreadyExistsException AuthenticationException AuthorizationException ConfigurationMismatchException CouldNotDeleteException CronException FileSystemException IntegrationException MailException NoSuchEntityException NotFoundException PaymentException RuntimeException SecurityViolationException SerializationException SessionException InitException StateException ValidatorException MessageLockException ChangelogTableNotExistsException Exception CookieSizeLimitReachedException FailureToSendException ValidationException ContentProcessorException Exception ColumnNotFoundException RowException UnsupportedVarnishVersion CommandException ClientException ConverterException ProcessableException CouldNotInvoiceException CouldNotRefundException CouldNotShipException DocumentValidationException MergeConflictException Exception GeneratorException StoreIsInactiveException Exception

Public Member Functions

 __construct (Phrase $phrase, \Exception $cause=null, $code=0)
 
 getRawMessage ()
 
 getParameters ()
 
 getLogMessage ()
 

Protected Attributes

 $phrase
 
 $logMessage
 

Detailed Description

@api

Since
100.0.2

Definition at line 17 of file LocalizedException.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( Phrase  $phrase,
\Exception  $cause = null,
  $code = 0 
)
Parameters
\Magento\Framework\Phrase$phrase
\Exception$cause
int$code

Definition at line 34 of file LocalizedException.php.

35  {
36  $this->phrase = $phrase;
37  parent::__construct($phrase->render(), intval($code), $cause);
38  }
$code
Definition: info.phtml:12

Member Function Documentation

◆ getLogMessage()

getLogMessage ( )

Get the un-localized message, but with the parameters filled in

Returns
string

Definition at line 65 of file LocalizedException.php.

66  {
67  if ($this->logMessage === null) {
68  $renderer = new Placeholder();
69  $this->logMessage = $renderer->render([$this->getRawMessage()], $this->getParameters());
70  }
71  return $this->logMessage;
72  }

◆ getParameters()

getParameters ( )

Get parameters, corresponding to placeholders in raw exception message

Returns
array

Definition at line 55 of file LocalizedException.php.

56  {
57  return $this->phrase->getArguments();
58  }

◆ getRawMessage()

getRawMessage ( )

Get the un-processed message, without the parameters filled in

Returns
string

Definition at line 45 of file LocalizedException.php.

46  {
47  return $this->phrase->getText();
48  }

Field Documentation

◆ $logMessage

$logMessage
protected

Definition at line 27 of file LocalizedException.php.

◆ $phrase

$phrase
protected

Definition at line 22 of file LocalizedException.php.


The documentation for this class was generated from the following file: