moved $language variable inside catch statement

As requested
This commit is contained in:
Paul Bovis
2015-11-17 14:25:51 -07:00
parent 3505ef046d
commit 3f94a6fda9

View File

@@ -72,13 +72,11 @@ class Blueprint
{
// Initialize data
$this->fields();
// Get language class
$language = self::getGrav()['language'];
try {
$this->validateArray($data, $this->nested);
} catch (\RuntimeException $e) {
$language = self::getGrav()['language'];
$message = sprintf($language->translate('FORM.VALIDATION_FAIL', null, true) . ' %s', $e->getMessage());
throw new \RuntimeException($message);
}