mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-05 04:46:03 +01:00
handle error on compile
This commit is contained in:
@@ -290,7 +290,11 @@ class AdminPlugin extends Plugin
|
||||
$obj = $event['object'];
|
||||
|
||||
if ($obj instanceof Data && $obj->blueprints()->getFilename() === 'admin/blueprints') {
|
||||
$this->grav['admin-whitebox']->compileScss($obj);
|
||||
|
||||
[$status, $msg] = $this->grav['admin-whitebox']->compileScss($obj);
|
||||
if (!$status) {
|
||||
$this->grav['messages']->add($msg, 'error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,11 @@ class Whitebox
|
||||
$preset_in_path = $admin_in_base .'/preset.scss';
|
||||
$preset_out_path = $custom_out_base . '/'. $options['filename'] . '.css';
|
||||
|
||||
try {
|
||||
$this->compilePresetScss($color_scheme, $preset_in_path, $preset_out_path);
|
||||
} catch (\Exception $e) {
|
||||
return [false, $e->getMessage()];
|
||||
}
|
||||
|
||||
return [true, 'Recompiled successfully'];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user