We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7666413 commit eed7726Copy full SHA for eed7726
src/Mariuzzo/LaravelJsLocalization/Generators/LangJsGenerator.php
@@ -2,6 +2,7 @@
2
3
namespace Mariuzzo\LaravelJsLocalization\Generators;
4
5
+use InvalidArgumentException;
6
use Illuminate\Filesystem\Filesystem as File;
7
use Illuminate\Support\Str;
8
use JShrink\Minifier;
@@ -149,6 +150,10 @@ protected function getMessages()
149
150
$key = $key.$this->stringsDomain;
151
$fileContent = file_get_contents($fullPath);
152
$messages[$key] = json_decode($fileContent, true);
153
+
154
+ if (json_last_error() !== JSON_ERROR_NONE) {
155
+ throw new InvalidArgumentException('Error while decode ' . basename($fullPath) . ': ' . json_last_error_msg());
156
+ }
157
}
158
159
0 commit comments