Files
vivespos-landing/modules/system/classes/ErrorHandler.php
avives 1f72193a64
Some checks are pending
Module sub-split / Sub-split (push) Waiting to run
feat: VivesPOS landing on Winter CMS 1.2 — theme + plugin + Dockerfile
- Base: wintercms/winter branch 1.2 (full framework)
- Theme vivespos: Canvas 7 + Bootstrap 5 CDN, custom CSS
- Layout: deferred GTM/GA4 tracking, JSON-LD SoftwareApplication
- Partials: hero (offline-first), features, modes (offline/nube toggle),
  screenshots, pricing (3 planes), comparison, FAQ, CTA
- Plugin VivesPOS.Site with ContactForm
- Dockerfile: PHP 8.2 Apache, port 80, healthcheck
- Added winter/wn-pages, blog, sitemap, seo plugins
- Active theme set to vivespos
2026-08-21 19:29:00 -06:00

84 lines
2.5 KiB
PHP

<?php namespace System\Classes;
use View;
use Config;
use Cms\Classes\Theme;
use Cms\Classes\Router;
use Cms\Classes\Controller as CmsController;
use Winter\Storm\Exception\ErrorHandler as ErrorHandlerBase;
use Winter\Storm\Exception\SystemException;
use Symfony\Component\HttpFoundation\Response;
/**
* System Error Handler, this class handles application exception events.
*
* @package winter\wn-system-module
* @author Alexey Bobkov, Samuel Georges
*/
class ErrorHandler extends ErrorHandlerBase
{
/**
* @inheritDoc
*/
// public function handleException(Exception $proposedException)
// {
// // The Twig runtime error is not very useful
// if (
// $proposedException instanceof \Twig\Error\RuntimeError &&
// ($previousException = $proposedException->getPrevious()) &&
// (!$previousException instanceof CmsException)
// ) {
// $proposedException = $previousException;
// }
// return parent::handleException($proposedException);
// }
/**
* Looks up an error page using the CMS route "/error". If the route does not
* exist, this function will use the error view found in the Cms module.
* @return mixed Error page contents.
*/
public function handleCustomError()
{
if (Config::get('app.debug', false)) {
return null;
}
if (class_exists(Theme::class) && in_array('Cms', Config::get('cms.loadModules', []))) {
$theme = Theme::getActiveTheme();
$router = new Router($theme);
// Use the default view if no "/error" URL is found.
if (!$router->findByUrl('/error')) {
return View::make('cms::error');
}
// Route to the CMS error page.
$controller = new CmsController($theme);
$result = $controller->run('/error');
} else {
$result = View::make('system::error');
}
// Extract content from response object
if ($result instanceof Response) {
$result = $result->getContent();
}
return $result;
}
/**
* Displays the detailed system exception page.
* @return View Object containing the error page.
*/
public function handleDetailedError($exception)
{
// Ensure System view path is registered
View::addNamespace('system', base_path().'/modules/system/views');
return View::make('system::exception', ['exception' => $exception]);
}
}