Skip to content

Commit

Permalink
minor #13509 [2.3] [HttpFoundation] [MimeTypeGuesser] Updated excepti…
Browse files Browse the repository at this point in the history
…on in MimeTypeGuesser (phansys)

This PR was merged into the 2.3 branch.

Discussion
----------

[2.3] [HttpFoundation] [MimeTypeGuesser] Updated exception in MimeTypeGuesser

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12857
| License       | MIT
| Doc PR        | none

Updated exception message in MimeTypeGuesser when no guessers available
(issue #12857).

Commits
-------

1e4a8d5 [2.3] [HttpFoundation] [MimeTypeGuesser]
  • Loading branch information
fabpot committed Jan 25, 2015
2 parents 6000f60 + 1e4a8d5 commit 17184f3
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -120,7 +120,11 @@ public function guess($path)
}

if (!$this->guessers) {
throw new \LogicException('Unable to guess the mime type as no guessers are available (Did you enable the php_fileinfo extension?)');
$msg = 'Unable to guess the mime type as no guessers are available';
if (!FileinfoMimeTypeGuesser::isSupported()) {
$msg .= ' (Did you enable the php_fileinfo extension?)';
}
throw new \LogicException($msg);
}

foreach ($this->guessers as $guesser) {
Expand Down

0 comments on commit 17184f3

Please sign in to comment.