You are here

public static function SwaggerUiLibraryDiscoveryException::becauseCannotReadPackageJsonContent in Swagger UI Field Formatter 8.3

Thrown when cannot read the Swagger UI library's package.json file.

Parameters

string $package_json_path: The Swagger UI library's package.json file path.

Return value

self The exception.

1 call to SwaggerUiLibraryDiscoveryException::becauseCannotReadPackageJsonContent()
SwaggerUiLibraryDiscovery::libraryVersion in src/Service/SwaggerUiLibraryDiscovery.php
Gets the Swagger UI library version.

File

src/Exception/SwaggerUiLibraryDiscoveryException.php, line 68

Class

SwaggerUiLibraryDiscoveryException
Base exception for Swagger UI library discovery.

Namespace

Drupal\swagger_ui_formatter\Exception

Code

public static function becauseCannotReadPackageJsonContent(string $package_json_path) : self {
  return new static(sprintf('Cannot read the content of the Swagger UI library\'s package.json file in "%s".', $package_json_path), self::CODE_CANNOT_READ_PACKAGE_JSON_CONTENT);
}