Message
API reference › Foxy › Exception › Message
Represents error message templates for Foxy exceptions.
Use Message::getMessage() to format the template with sprintf() arguments.
| Case | Value | Description |
|---|---|---|
ASSET_BUN_AUDIT_CONFIG_UNREADABLE | 'The Bun audit configuration "%s" cannot be read.' | Error when a Bun audit configuration file (bunfig.toml or .npmrc) cannot be read. |
ASSET_BUN_AUDIT_REASON_NPMRC_KEY_ESCAPES | 'escape sequences in npmrc keys are not supported; use canonical ' . 'keys' | Reason fragment when npmrc keys contain escape sequences. |
ASSET_BUN_AUDIT_REASON_NPMRC_OMIT_ESCAPES | 'escape sequences in npmrc omit values are not supported; use ' . 'canonical values' | Reason fragment when npmrc omit values contain escape sequences. |
ASSET_BUN_AUDIT_REASON_TOML_ARRAY_INSTALL_TABLE | 'array install tables are not supported; use an [install] ' . 'table' | Reason fragment when bunfig declares an array install table. |
ASSET_BUN_AUDIT_REASON_TOML_INLINE_INSTALL_TABLE | 'inline install tables are not supported; use an ' . '[install] table' | Reason fragment when bunfig declares an inline install table. |
ASSET_BUN_AUDIT_REASON_TOML_KEY_ESCAPES | 'escape sequences in TOML keys are not supported; use canonical ' . 'keys' | Reason fragment when bunfig keys contain escape sequences. |
ASSET_BUN_AUDIT_REASON_TOML_MULTILINE_CONTAINER | 'multiline container values in [install] are not supported' | Reason fragment when an [install] value is a multiline array or inline table. |
ASSET_BUN_AUDIT_REASON_TOML_MULTILINE_STRING | 'multiline strings in [install] are not supported' | Reason fragment when an [install] value is a multiline string. |
ASSET_BUN_AUDIT_REASON_UTF8_REQUIRED | 'the configuration must be UTF-8' | Reason fragment when an audit configuration is not valid UTF-8. |
ASSET_BUN_AUDIT_SCOPE_RESTRICTED | 'The Bun audit cannot guarantee the requested dependency scope because ' . '"%s" declares "%s".' | Error when a Bun configuration file (bunfig.toml or .npmrc) restricts the audited dependency scope. |
ASSET_BUN_AUDIT_SCOPE_UNVERIFIABLE | 'The Bun audit cannot verify dependency scope in "%s": %s.' | Error when the dependency scope of a Bun configuration file (bunfig.toml or .npmrc) cannot be verified. |
ASSET_DENO_AUDIT_NO_DEV_UNSUPPORTED | 'The Deno audit cannot guarantee the requested dependency scope ' . 'because "deno audit" cannot exclude development dependencies.' | Error when a production-only Deno audit is requested. |
ASSET_DENO_COMPOSER_ASSET_NOT_NESTED | 'The Composer asset "%s" must be located in a subdirectory of the ' . 'root package directory to be installed with Deno.' | Error when a Composer asset is not nested in the root package directory. |
ASSET_DENO_WORKSPACES_INVALID | 'The "workspaces" field of "%s" must be a list of strings to install ' . 'Composer assets with Deno.' | Error when the Deno “workspaces” field is not a list of strings. |
ASSET_MANAGER_BINARY_NOT_INSTALLED | 'The "%s" binary must be installed.' | Error when the asset manager binary is not installed. |
ASSET_MANAGER_LOCK_FILE_MISSING | 'The %s lock file "%s" was not found.' | Error when an audit is requested without the manager lock file. |
ASSET_MANAGER_LOCK_FILES_AMBIGUOUS | 'Multiple asset manager lock files were found; configure "manager" ' . 'explicitly.' | Error when several asset manager lock files exist. |
ASSET_MANAGER_LOCKED_UNAVAILABLE | 'The asset manager "%s" selected by its lock file is not available.' | Error when the asset manager selected by its lock file is unavailable. |
ASSET_MANAGER_NONE_FOUND | 'No asset manager was found.' | Error when no asset manager is found. |
ASSET_MANAGER_UNKNOWN | 'The asset manager "%s" doesn\ | Error when the configured asset manager does not exist. |
ASSET_NATIVE_AUDIT_NO_DEV_UNSUPPORTED | 'The native audit cannot guarantee the requested dependency scope ' . 'because the native manager installs development dependencies together with the others.' | Error when a production-only audit is requested for the native manager. |
ASSET_NPM_WORKSPACE_GRAPH_UNENUMERABLE | 'The npm workspace graph could not be enumerated from ' . 'package-lock.json. Regenerate the lock file with a supported npm version.' | Error when the npm workspace graph cannot be enumerated. |
ASSET_ROOT_PACKAGE_DIR_MISSING | 'The root package directory "%s" doesn\ | Error when the root package directory does not exist. |
ASSET_VERSION_CONSTRAINT_MISMATCH | 'The installed %s version "%s" doesn\ | Error when the installed version does not satisfy the configured “manager-version”. |
ASSET_VERSION_UNSUPPORTED | 'The installed %s version "%s" doesn\ | Error when the installed version does not satisfy the supported constraint. |
AUDIT_BULK_PACKAGE_ADVISORIES_REQUIRED | 'each package must contain a list of advisories' | Bulk advisory parser detail when a package lacks an advisory list. |
AUDIT_BUN_PARTIAL_REPORT | 'The Bun audit command produced diagnostics and may have returned a partial ' . 'report. %s' | Error when Bun reports diagnostics that may indicate a partial report. |
AUDIT_COMMAND_FAILED | 'The %s audit command failed with status code %d.' | Error when the audit command fails without diagnostics. |
AUDIT_COMMAND_FAILED_WITH_DIAGNOSTICS | 'The %s audit command failed with status code %d. %s' | Error when the audit command fails and emits diagnostics. |
AUDIT_CVE_RESOLUTION_MISSING | 'The CVE resolver returned no result for "%s".' | Error when a CVE resolver answers a batch without one of the requested advisories. |
AUDIT_DENO_ADVISORY_ACTIONS_MISMATCH | '%s actions must update the package to its patched versions' | Deno parser detail when advisory actions do not match the patched versions. |
AUDIT_DENO_ADVISORY_LINE_COUNT_INVALID | '%s must contain %d or %d lines' | Deno parser detail when an advisory block has an unexpected line count. |
AUDIT_DENO_ADVISORY_LINE_UNRECOGNIZED | '%s line %d is not recognized' | Deno parser detail when an advisory line is not recognized. |
AUDIT_DENO_REPORT_EMPTY | 'the report is empty' | Deno parser detail when the report is empty. |
AUDIT_DENO_REPORT_NO_ADVISORY | 'the report does not contain any advisory' | Deno parser detail when the report contains no advisory. |
AUDIT_DENO_SUMMARY_SEVERITY_MISMATCH | 'the summary reports %d %s vulnerabilities but the report contains %d' | Deno parser detail when a severity count differs from the summary. |
AUDIT_DENO_SUMMARY_TOTAL_MISMATCH | 'the summary reports %d vulnerabilities but the report contains %d ' . 'advisories' | Deno parser detail when the advisory count differs from the summary. |
AUDIT_DENO_SUMMARY_UNRECOGNIZED | 'the report does not end with a recognized summary' | Deno parser detail when the summary line is missing or unrecognized. |
AUDIT_FIELD_BOOLEAN_REQUIRED | '%s.%s must be a boolean' | Parser detail when a field is not a boolean. |
AUDIT_FIELD_NON_NEGATIVE_INTEGER_REQUIRED | '%s.%s must be a non-negative integer' | Parser detail when a field is not a non-negative integer. |
AUDIT_FIELD_STRING_REQUIRED | '%s.%s must be a string' | Parser detail when a field is not a string. |
AUDIT_GHSA_ID_INVALID | 'The advisory identifier "%s" is not a valid GHSA identifier.' | Error when an advisory identifier is not a valid GHSA identifier. |
AUDIT_GITHUB_ADVISORY_INVALID | 'GitHub returned an invalid advisory document for %s.' | Error when the GitHub advisory response is not a JSON object. |
AUDIT_GITHUB_ADVISORY_MISMATCHED | 'GitHub returned a mismatched advisory document for %s.' | Error when the GitHub advisory response belongs to another advisory. |
AUDIT_GITHUB_IDENTIFIERS_INVALID | 'GitHub returned invalid identifiers for %s.' | Error when the GitHub advisory identifiers are not a list. |
AUDIT_MANAGER_ERROR_APPENDED | '%s Manager error: %s' | Appends the manager diagnostics to a parser failure message. |
AUDIT_NPM_FIX_AVAILABLE_INVALID | '%s.fixAvailable must be a boolean or object' | Npm parser detail when “fixAvailable” has an invalid type. |
AUDIT_NPM_METADATA_COUNT_MISMATCH | 'metadata vulnerability counts must equal the vulnerability entries' | Npm parser detail when metadata counts differ from the entries. |
AUDIT_NPM_NAME_KEY_MISMATCH | '%s.name must match its vulnerability key' | Npm parser detail when a vulnerability name differs from its key. |
AUDIT_NPM_REPORT_VERSION_UNSUPPORTED | 'auditReportVersion must be 2' | Npm parser detail when the report version is not 2. |
AUDIT_NPM_VIA_ENTRY_INVALID | '%s.via.%d must be a string or object' | Npm parser detail when a “via” entry has an invalid type. |
AUDIT_NPM_VIA_LIST_EMPTY | '%s.via must be a non-empty list' | Npm parser detail when “via” is empty or not a list. |
AUDIT_NPM_VULNERABILITY_KEY_REQUIRED | 'each vulnerability must be keyed by a package name' | Npm parser detail when a vulnerability has an empty key. |
AUDIT_OUTPUT_MALFORMED | 'The %s audit output is malformed: %s.' | Error wrapper for malformed audit output; the second argument is a parser detail case. |
AUDIT_PNPM_FINDINGS_EMPTY | '%s.findings must be a non-empty list' | Pnpm parser detail when an advisory has no findings. |
AUDIT_PNPM_ID_INVALID | '%s.id must be a non-negative integer' | Pnpm parser detail when an advisory id is invalid. |
AUDIT_PNPM_ID_KEY_MISMATCH | '%s.id must match its advisory key' | Pnpm parser detail when an advisory id differs from its key. |
AUDIT_PNPM_METADATA_COUNT_MISMATCH | 'metadata vulnerability counts must equal the advisory entries' | Pnpm parser detail when metadata counts differ from the entries. |
AUDIT_REPORT_ERROR_DOCUMENT | 'the manager returned an error document' | Parser detail when the manager returned an error document. |
AUDIT_REPORT_JSON_INVALID | 'invalid JSON' | Parser detail when the report is not valid JSON. |
AUDIT_REPORT_JSON_OBJECT_EXPECTED | 'expected a JSON object' | Parser detail when the report is not a JSON object. |
AUDIT_REPORT_SIZE_LIMIT_EXCEEDED | 'the report exceeds the 16 MiB safety limit' | Parser detail when the report exceeds the size limit. |
AUDIT_SEVERITY_TOTAL_MISMATCH | '%s.vulnerabilities.total must equal the severity counts' | Parser detail when the severity total differs from the sum of counts. |
AUDIT_SUCCESS_STATUS_WITH_FINDINGS | 'The %s audit report contains vulnerabilities but the manager returned ' . 'a successful status.' | Error when a successful exit status accompanies reported vulnerabilities. |
AUDIT_VALUE_CVE_INVALID | '%s contains an invalid CVE identifier' | Parser detail when a value contains an invalid CVE identifier. |
AUDIT_VALUE_EMPTY | '%s must not be empty' | Parser detail when a value is empty. |
AUDIT_VALUE_LIST_REQUIRED | '%s must be a list' | Parser detail when a value is not a list. |
AUDIT_VALUE_OBJECT_REQUIRED | '%s must be an object' | Parser detail when a value is not an object. |
AUDIT_VALUE_SEVERITY_UNSUPPORTED | '%s has an unsupported severity' | Parser detail when a severity is unsupported. |
AUDIT_VALUE_STRING_OR_INTEGER_REQUIRED | '%s must be a string or integer' | Parser detail when a value is neither a string nor an integer. |
AUDIT_VALUE_STRINGS_ONLY | '%s must contain only strings' | Parser detail when a list contains non-string items. |
AUDIT_YARN_LINE_JSON_INVALID | 'line %d contains invalid JSON' | Yarn parser detail when a line is not valid JSON. |
AUDIT_YARN_LINE_NOT_FINDING | 'line %d is not an audit finding' | Yarn parser detail when a line is not an audit finding. |
COMMAND_CAPABILITY_ARGUMENTS_INVALID | 'Composer provided invalid Foxy command capability arguments.' | Error when Composer passes invalid command capability arguments. |
CONFIG_ENV_JSON_INVALID | 'The "%s" environment variable isn\ | Error when an environment variable does not contain valid JSON. |
CURRENT_WORKING_DIRECTORY_UNAVAILABLE | 'Unable to get the current working directory.' | Error when the current working directory cannot be determined. |
FALLBACK_ASSET_PATH_NOT_FILE | 'The fallback asset path "%s" must be a regular file.' | Error when the fallback asset path is not a regular file. |
FALLBACK_ASSET_READ_FAILED | 'Unable to read fallback asset file "%s".' | Error when the fallback asset file cannot be read. |
FALLBACK_ASSET_REMOVE_FAILED | 'Unable to remove fallback asset file "%s".' | Error when the fallback asset file cannot be removed. |
FALLBACK_ASSET_WRITE_FAILED | 'Unable to write fallback asset file "%s".' | Error when the fallback asset file cannot be written. |
FALLBACK_COMPOSER_REMOVE_FAILED | 'Unable to remove Composer fallback path "%s".' | Error when a Composer fallback path cannot be removed. |
FALLBACK_COMPOSER_RESTORE_FAILED | 'Unable to restore Composer dependencies, | Error when the Composer installer fails during restoration. |
FOXY_AUDIT_DISABLED | 'Foxy is disabled; frontend dependencies cannot be audited.' | Error when an audit is requested while Foxy is disabled. |
JSON_FILE_UNREADABLE | 'Unable to read JSON file "%s".' | Error when a JSON file cannot be read. |
NATIVE_EXTENSION_MISSING | 'The native manager requires the "%s" PHP extension.' | Error when a PHP extension required by the native manager is not loaded. |
NATIVE_INSTALL_DIR_INVALID | 'The native install directory "%s" must not be the root package directory, | Error when the native install directory would make the installer prune the project. |
NATIVE_INSTALL_DIR_OVERLAPS_LOCAL | 'The native install directory "%s" overlaps the local package "%s" at "%s".' | Error when a local package directory is the native install directory, lies under it, or contains it. |
NATIVE_INTEGRITY_MISMATCH | 'The tarball "%s" failed its integrity check.' | Error when a downloaded tarball does not match its integrity hash. |
NATIVE_LOCAL_PACKAGE_MISSING | 'The local package "%s" of "%s" has no package.json.' | Error when a file: dependency directory has no package.json. |
NATIVE_LOCAL_VERSION_CONFLICT | 'The local package "%s" (%s) does not satisfy %s; install it with npm, | Error when a requirement rejects the version of a local package. |
NATIVE_LOCK_INVALID | 'The lock file "%s" is malformed; delete it and run the installation again.' | Error when the native manager lock file is malformed. |
NATIVE_MANIFEST_DEPENDENCIES_INVALID | 'The "%s" field of "%s" must map package names to version strings.' | Error when a manifest dependency field does not map package names to version strings. |
NATIVE_METADATA_INVALID | 'The registry metadata of "%s" is malformed: %s.' | Error when the registry metadata of a package is malformed. |
NATIVE_METADATA_REASON_DIST_HASH_REQUIRED | '%s must declare dist.integrity or dist.shasum' | Reason fragment when a registry version declares neither dist.integrity nor dist.shasum. |
NATIVE_METADATA_REASON_JSON_INVALID | 'the document is not valid JSON' | Reason fragment when the registry metadata document is not valid JSON. |
NATIVE_METADATA_REASON_OBJECT_REQUIRED | '%s must be a JSON object' | Reason fragment when a registry metadata member is not an object. |
NATIVE_METADATA_REASON_STRING_MAP_REQUIRED | '%s must map names to strings' | Reason fragment when a registry metadata member does not map names to strings. |
NATIVE_METADATA_REASON_STRING_REQUIRED | '%s must be a string' | Reason fragment when a registry metadata member is not a non-empty string. |
NATIVE_PACKAGE_COPY_FAILED | 'Unable to copy the local package "%s" to "%s".' | Error when a local file: package cannot be copied into node_modules. |
NATIVE_PACKAGE_NOT_FOUND | 'The package "%s" was not found in the registry "%s".' | Error when the registry does not know a package. |
NATIVE_PACKAGE_REMOVE_FAILED | 'Unable to remove the package directory "%s".' | Error when an installed package directory cannot be removed. |
NATIVE_RANGE_INVALID | 'The version "%s" of "%s" is neither a valid npm range nor a dist-tag.' | Error when a dependency version is neither a valid npm range nor a dist-tag. |
NATIVE_REGISTRY_REQUEST_FAILED | 'The registry request "%s" failed: %s' | Error when a registry request fails. |
NATIVE_SPEC_UNSUPPORTED | 'The native manager does not support the "%s" specification of "%s"; use npm, | Error when a dependency uses a specification the native manager does not support. |
NATIVE_TARBALL_INVALID | 'The tarball "%s" cannot be extracted: %s.' | Error when a tarball cannot be extracted. |
NATIVE_TARBALL_REASON_ENTRY_ESCAPES | 'the entry "%s" escapes the package directory' | Reason fragment when a tarball entry resolves outside the package directory. |
NATIVE_TARBALL_REASON_NOT_USTAR | 'the archive is not a valid ustar archive' | Reason fragment when a tarball header fails the ustar magic or checksum check. |
NATIVE_TARBALL_REASON_TRUNCATED | 'the archive is truncated' | Reason fragment when a tarball ends inside a header or a data block. |
NATIVE_TARBALL_REASON_UNREADABLE | 'the archive cannot be opened' | Reason fragment when a tarball cannot be opened as a gzip stream. |
NATIVE_TARBALL_REASON_WRITE_FAILED | 'the entry "%s" cannot be written' | Reason fragment when a tarball entry cannot be written to disk. |
NATIVE_VERSION_CONFLICT | 'No version of "%s" satisfies %s; install it with npm, | Error when no registry version satisfies every accumulated constraint of a package. |
SOLVER_ASSET_DIR_CREATE_FAILED | 'Unable to create Composer asset directory "%s".' | Error when the Composer asset directory cannot be created. |
SOLVER_ASSET_DIR_EMPTY | 'The Composer asset directory must not be empty.' | Error when the Composer asset directory is empty. |
SOLVER_ASSET_DIR_INSPECT_FAILED | 'Unable to inspect Composer asset directory "%s".' | Error when the Composer asset directory cannot be inspected. |
SOLVER_ASSET_DIR_IS_ROOT | 'The Composer asset directory must not be a filesystem root.' | Error when the Composer asset directory is a filesystem root. |
SOLVER_ASSET_DIR_MARK_FAILED | 'Unable to mark Composer asset directory "%s".' | Error when the ownership marker cannot be written. |
SOLVER_ASSET_DIR_NOT_STRING | 'The Composer asset directory must be a string.' | Error when “composer-asset-dir” is not a string. |
SOLVER_ASSET_DIR_OVERLAPS_PROTECTED | 'The Composer asset directory "%s" overlaps a protected project path.' | Error when the asset directory overlaps a protected path. |
SOLVER_ASSET_DIR_RESET_FAILED | 'Unable to reset Composer asset directory "%s".' | Error when the asset directory cannot be reset. |
SOLVER_ASSET_DIR_SYMLINK | 'The Composer asset directory "%s" must not be a symbolic link.' | Error when the asset directory is a symbolic link. |
SOLVER_ASSET_DIR_UNMANAGED | 'The Composer asset directory "%s" is not marked as managed by Foxy.' | Error when a non-empty asset directory is not managed by Foxy. |
SOLVER_ASSET_FALLBACK_RESTORE_FAILED | 'The asset manager failed and its fallback could not be restored: %s' | Error when restoring the asset fallback after an asset manager failure also fails. |
SOLVER_ASSET_MANAGER_FAILED | 'The asset manager ended with error code %d.' | Error when the asset manager ends with a non-zero code. |
SOLVER_ASSET_PATH_NOT_DIRECTORY | 'The Composer asset path "%s" is not a directory.' | Error when the asset path exists but is not a directory. |
SOLVER_COMPOSER_FALLBACK_RESTORE_FAILED | 'Asset solving failed and Composer fallback restoration failed: %s' | Error when Composer fallback restoration fails after a solve failure. |
SOLVER_MANIFEST_READ_FAILED | 'Unable to read asset manifest "%s".' | Error when an asset manifest cannot be read. |
SOLVER_MANIFEST_WRITE_FAILED | 'Unable to write asset manifest "%s".' | Error when an asset manifest cannot be written. |
SOLVER_PACKAGE_DIR_CREATE_FAILED | 'Unable to create asset directory "%s".' | Error when a package asset directory cannot be created. |
SOLVER_PATH_RESOLVE_FAILED | 'Unable to resolve path "%s".' | Error when a path cannot be resolved. |
UTIL_ASSET_PACKAGE_PATH_ESCAPES | 'The asset package path "%s" escapes its Composer install directory.' | Error when an asset package path escapes its install directory. |
UTIL_COMPOSER_PACKAGE_FILE_UNREADABLE | 'Unable to read Composer package file "%s".' | Error when a Composer package file cannot be read. |
UTIL_COMPOSER_VERSION_UNSUPPORTED | 'Foxy requires Composer "%s", | Error when the Composer version is below the minimum. |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
getMessage() | Returns the formatted message string for the error case. | Message |
Method details
Section titled “Method details”getMessage()
Section titled “getMessage() ”public function getMessage(int|string ...$argument): stringReturns the formatted message string for the error case.
Parameters
| Parameter | Type | Description |
|---|---|---|
...$argument | int| | Values to insert into the message template. |
Returns
string: Formatted error message with interpolated arguments.