Skip to content
Snippets Groups Projects
Commit 2af0ddba authored by jansete's avatar jansete Committed by jansete
Browse files

Issue #2860159 by jansete: Exception in admin/config/media/file-system when...

Issue #2860159 by jansete: Exception in admin/config/media/file-system when s3fs is enabled but not configured
parent c0f9f559
No related branches found
Tags 5.x-3.1
No related merge requests found
......@@ -12,6 +12,7 @@ use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Url;
use Drupal\image\Entity\ImageStyle;
use Drupal\s3fs\S3fsException;
use Psr\Log\LogLevel;
/**
* Defines a Drupal s3 (s3://) stream wrapper class.
......@@ -105,7 +106,11 @@ class S3fsStream extends StreamWrapper implements StreamWrapperInterface {
}
if (!$this->s3fs->validate($this->config)) {
throw new S3fsException('Unable to validate your s3fs configuration settings. Please configure S3 File System from the admin/config/media/s3fs page and try again.');
$message = $this->t('Unable to validate your s3fs configuration settings. Please configure S3 File System from the admin/config/media/s3fs page and try again.');
if (\Drupal::service('current_route_match')->getRouteName() == 'system.file_system_settings') {
return drupal_set_message($message, LogLevel::ERROR);
}
throw new S3fsException($message);
}
$this->s3 = $this->getClient();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment