# Message

> Defines exception message templates used by the Yii debug adapter.

[API reference](/docs/api/index.md) › [Debug](/docs/extensions/debug/reference/index.md) › [exception](/docs/extensions/debug/reference/exception/index.md) › Message

| enum | `yii\debug\exception\Message` |
| --- | --- |
| Backed by | `string` |
| Source | [`src/exception/Message.php`](https://github.com/yii2-extensions/debug/blob/main/src/exception/Message.php#L14) |

Defines exception message templates used by the Yii debug adapter.

Use [`Message::getMessage()`](/docs/extensions/debug/reference/exception/message/index.md#method-getMessage) to format a template with `sprintf()` arguments.

## Cases

| Case | Value | Description |
| --- | --- | --- |
| <span id="case-ACCESS_DENIED"></span>`ACCESS_DENIED` | `'You are not allowed to access this page.'` | Access to the requested debug page is denied. |
| <span id="case-ACCESS_DENIED_BY_CALLBACK"></span>`ACCESS_DENIED_BY_CALLBACK` | `'Access to debugger is denied due to checkAccessCallback.'` | Access to the debugger is denied by the configured callback. |
| <span id="case-ACTIVE_SESSION_REQUIRED"></span>`ACTIVE_SESSION_REQUIRED` | `'Need an active session'` | An active session is required. |
| <span id="case-CAPTURED_MAIL_FILE_MODE_FAILED"></span>`CAPTURED_MAIL_FILE_MODE_FAILED` | `'Unable to apply mode to captured mail file: %s'` | The mode cannot be applied to a captured mail file. |
| <span id="case-CAPTURED_MAIL_FILE_NAME_INVALID"></span>`CAPTURED_MAIL_FILE_NAME_INVALID` | `'Invalid captured mail file name: %s'` | A captured mail file name is invalid. |
| <span id="case-CAPTURED_MAIL_FILE_PERSIST_FAILED"></span>`CAPTURED_MAIL_FILE_PERSIST_FAILED` | `'Unable to persist captured mail file: %s'` | A captured mail file cannot be persisted. |
| <span id="case-COLLECTOR_CLASS_INVALID"></span>`COLLECTOR_CLASS_INVALID` | `'Debug collector configuration must declare a valid class name.'` | The collector configuration lacks a valid class name. |
| <span id="case-COLLECTOR_ENABLED_INVALID"></span>`COLLECTOR_ENABLED_INVALID` | `"Debug collector '%s' must declare 'enabled' as a boolean."` | A collector entry declares a non-boolean `enabled` flag. |
| <span id="case-COLLECTOR_INTERFACE_INVALID"></span>`COLLECTOR_INTERFACE_INVALID` | `'Debug collector class must implement %s: %s.'` | The configured collector does not implement the required interface. |
| <span id="case-COLLECTORS_NOT_INITIALIZED"></span>`COLLECTORS_NOT_INITIALIZED` | `'Debug collectors have not been initialized.'` | The debug collectors have not been initialized. |
| <span id="case-CSRF_VALIDATION_FAILED"></span>`CSRF_VALIDATION_FAILED` | `'Unable to verify your data submission.'` | CSRF validation has failed. |
| <span id="case-DB_COMPONENT_INVALID"></span>`DB_COMPONENT_INVALID` | `"Application component '%s' must be a DB connection."` | An application component is not a database connection. |
| <span id="case-DEBUG_ACTION_MODULE_INVALID"></span>`DEBUG_ACTION_MODULE_INVALID` | `'Debug actions must be dispatched through the debug module.'` | A debug action is dispatched through an incompatible module. |
| <span id="case-DEBUG_DATA_EMPTY"></span>`DEBUG_DATA_EMPTY` | `'No debug data have been collected yet, try browsing the website first.'` | No debug data have been collected. |
| <span id="case-DEBUG_DATA_NOT_FOUND"></span>`DEBUG_DATA_NOT_FOUND` | `"Unable to find debug data tagged with '%s'."` | Debug data cannot be found for a tag. |
| <span id="case-DEBUG_DATA_SUMMARY_MISSING"></span>`DEBUG_DATA_SUMMARY_MISSING` | `"Debug data tagged with '%s' does not contain summary data."` | Tagged debug data omit the summary payload. |
| <span id="case-DEBUG_DATA_SUMMARY_UNAVAILABLE"></span>`DEBUG_DATA_SUMMARY_UNAVAILABLE` | `"Debug data tagged with '%s' has no summary."` | A summary is unavailable for tagged debug data. |
| <span id="case-DEBUG_PANEL_NOT_FOUND"></span>`DEBUG_PANEL_NOT_FOUND` | `"Debug panel '%s' not found."` | A requested debug panel cannot be found. |
| <span id="case-DEBUG_TAG_NOT_FOUND"></span>`DEBUG_TAG_NOT_FOUND` | `'Debug tag not found.'` | The requested capture tag cannot be resolved. |
| <span id="case-DISPATCHER_COLLECTOR_NOT_DISPATCHER"></span>`DISPATCHER_COLLECTOR_NOT_DISPATCHER` | `"Debug collector '%s' must implement %s to be handed to a component as its dispatcher."` | A `dispatchers` entry names a collector that cannot act as a PSR-14 dispatcher. |
| <span id="case-DISPATCHER_COLLECTOR_UNKNOWN"></span>`DISPATCHER_COLLECTOR_UNKNOWN` | `"Debug dispatcher '%s' names no configured collector."` | A `dispatchers` entry names a collector that is neither registered nor disabled. |
| <span id="case-DISPATCHER_COMPONENT_INSTANTIATED"></span>`DISPATCHER_COMPONENT_INSTANTIATED` | `"Application component '%s' is already instantiated and exposes no writable 'eventDispatcher' property."` | A `dispatchers` entry targets a component that is already built and has no writable dispatcher property. |
| <span id="case-DISPATCHER_COMPONENT_UNKNOWN"></span>`DISPATCHER_COMPONENT_UNKNOWN` | `"Debug dispatcher '%s' targets the unknown application component '%s'."` | A `dispatchers` entry targets a component the application does not declare. |
| <span id="case-DISPATCHER_TARGET_UNSUPPORTED"></span>`DISPATCHER_TARGET_UNSUPPORTED` | `"Application component '%s' must be a class name or configuration array declaring an 'eventDispatcher' " . 'property or constructor parameter.'` | A `dispatchers` entry targets a component definition that cannot take the collector. |
| <span id="case-IDENTITY_CLASS_NOT_CONFIGURED"></span>`IDENTITY_CLASS_NOT_CONFIGURED` | `'User component is not configured with an identity class.'` | The user component lacks an identity class. |
| <span id="case-IDENTITY_NOT_FOUND"></span>`IDENTITY_NOT_FOUND` | `'Identity not found.'` | The requested identity cannot be found. |
| <span id="case-IDENTITY_REQUIRED_FOR_SWITCH"></span>`IDENTITY_REQUIRED_FOR_SWITCH` | `'Cannot switch to a user without an attached identity.'` | User switching requires an attached identity. |
| <span id="case-LOG_MESSAGE_NOT_FOUND"></span>`LOG_MESSAGE_NOT_FOUND` | `'Log message not found.'` | A requested log message cannot be found. |
| <span id="case-LOG_TARGET_CLASS_INVALID"></span>`LOG_TARGET_CLASS_INVALID` | `'Debug module logTarget configuration must declare a valid class name.'` | The log target configuration lacks a valid class name. |
| <span id="case-LOG_TARGET_INSTANCE_INVALID"></span>`LOG_TARGET_INSTANCE_INVALID` | `'Debug module logTarget must resolve to a yii\debug\LogTarget instance.'` | The configured log target resolves to an incompatible instance. |
| <span id="case-LOG_TARGET_NOT_BOOTSTRAPPED"></span>`LOG_TARGET_NOT_BOOTSTRAPPED` | `'Debug module logTarget has not been bootstrapped; call Module::bootstrap() first.'` | The debug module log target has not been bootstrapped. |
| <span id="case-LOG_TARGET_NOT_INITIALIZED_FOR_LOADING"></span>`LOG_TARGET_NOT_INITIALIZED_FOR_LOADING` | `'The debug module logTarget must be initialized before loading debug data.'` | The log target is unavailable for loading debug data. |
| <span id="case-LOG_TARGET_NOT_INITIALIZED_FOR_READING"></span>`LOG_TARGET_NOT_INITIALIZED_FOR_READING` | `'The debug module logTarget must be initialized before reading log messages.'` | The log target is unavailable for reading log messages. |
| <span id="case-MAIL_COLLECTOR_NOT_FOUND"></span>`MAIL_COLLECTOR_NOT_FOUND` | `'Mail collector not found.'` | The mail collector cannot be found. |
| <span id="case-MAIL_FILE_NOT_FOUND"></span>`MAIL_FILE_NOT_FOUND` | `'Mail file not found'` | A requested captured mail file cannot be found. |
| <span id="case-PANEL_CLASS_INVALID"></span>`PANEL_CLASS_INVALID` | `"Debug panel '%s' configuration must declare a valid class name."` | A panel configuration lacks a resolvable class name. |
| <span id="case-PANEL_ID_DUPLICATE"></span>`PANEL_ID_DUPLICATE` | `'Duplicate debug panel ID: %s.'` | A registration ID is declared twice. |
| <span id="case-PANEL_INSTANCE_INVALID"></span>`PANEL_INSTANCE_INVALID` | `"Debug panel '%s' must resolve to a %s instance: %s."` | A panel configuration resolves to an object outside the panel contract. |
| <span id="case-PANEL_METADATA_OVERRIDE_UNSUPPORTED"></span>`PANEL_METADATA_OVERRIDE_UNSUPPORTED` | `"Debug panel '%s' registration options 'title' and 'icon' apply to portable panels only."` | A title or icon override targets a panel that renders its own metadata. |
| <span id="case-PANEL_PAYLOAD_EXPECTED"></span>`PANEL_PAYLOAD_EXPECTED` | `'a payload supported by this panel'` | A panel receives an unsupported hydration payload. |
| <span id="case-PANELS_NOT_INITIALIZED"></span>`PANELS_NOT_INITIALIZED` | `'Debug panels have not been initialized.'` | The debug panels have not been initialized. |
| <span id="case-PORTABLE_PANEL_NOT_HYDRATED"></span>`PORTABLE_PANEL_NOT_HYDRATED` | `'No portable panel capture has been hydrated.'` | A portable panel is rendered before any capture was hydrated into it. |
| <span id="case-POST_ONLY"></span>`POST_ONLY` | `'Only POST requests are allowed.'` | The request must use the POST method. |
| <span id="case-PROVIDER_ID_MISMATCH"></span>`PROVIDER_ID_MISMATCH` | `'The debug %s registration ID must match its provider.'` | A configured registration ID does not match the provider it wraps. |
| <span id="case-PROVIDER_PANEL_REQUIRED"></span>`PROVIDER_PANEL_REQUIRED` | `'A declarative debug panel provider must be configured.'` | A provider-backed panel is used without its declarative provider. |
| <span id="case-QUEUE_JOB_RECORD_NOT_FOUND"></span>`QUEUE_JOB_RECORD_NOT_FOUND` | `'Queue job record not found.'` | A requested queue job record cannot be found. |
| <span id="case-REQUIRED_SERVICE_NOT_FOUND"></span>`REQUIRED_SERVICE_NOT_FOUND` | `'Could not load required service: %s'` | Yii cannot resolve a required action service. |
| <span id="case-SEARCH_MODEL_REQUIRED"></span>`SEARCH_MODEL_REQUIRED` | `'%s::$searchModel must be set.'` | A filter banner lacks its required search model. |
| <span id="case-SERVICE_INSTANCE_INVALID"></span>`SERVICE_INSTANCE_INVALID` | `'Debug module service must resolve to a %s instance.'` | A module service definition resolves to an object outside the service contract. |
| <span id="case-SHELL_CONTEXT_REQUIRED"></span>`SHELL_CONTEXT_REQUIRED` | `'The debug layout requires a ShellContext.'` | The debug layout lacks its required shell context. |
| <span id="case-TOOLBAR_ENVELOPE_INVALID"></span>`TOOLBAR_ENVELOPE_INVALID` | `"Debug panel '%s' returned an invalid toolbar envelope: '%s'."` | A panel toolbar envelope breaks the typed toolbar contract. |
| <span id="case-USER_COMPONENT_INVALID"></span>`USER_COMPONENT_INVALID` | `"Application component '%s' must be a 'yii\\web\\User' instance."` | An application component is not a Yii web user instance. |
| <span id="case-USER_FILTER_MODEL_INVALID"></span>`USER_FILTER_MODEL_INVALID` | `'User filter model must implement %s.'` | The user filter model does not implement the required interface. |
| <span id="case-USER_ID_INVALID"></span>`USER_ID_INVALID` | `'Invalid user_id parameter.'` | A supplied user identifier is invalid. |
| <span id="case-USER_SWITCH_MODULE_REQUIRED"></span>`USER_SWITCH_MODULE_REQUIRED` | `'Unable to configure user switching without a debug module.'` | User switching cannot be configured without a debug module. |
| <span id="case-YII_LOGO_UNREADABLE"></span>`YII_LOGO_UNREADABLE` | `'Unable to read the packaged Yii logo.'` | The packaged Yii logo cannot be read. |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`getMessage()`](#method-getMessage) | Formats the message template with the supplied arguments. | `Message` |

## Method details

### getMessage() <span id="method-getMessage"></span>

```php
public function getMessage(int|string ...$argument): string
```

Formats the message template with the supplied arguments.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `...$argument` | `int\|string` | Values inserted into the template. |

**Returns**

`string`: Formatted exception message.