GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - codin/fault: Basic Error and Exception Handler

BranchesTags
Open more actions menu

Latest commit

 

History

28 Commits
28 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
resources
resources
 
 
spec
spec
 
 
src
src
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
composer.json
composer.json
 
 
example.php
example.php
 
 
license.txt
license.txt
 
 
phpspec.yml
phpspec.yml
 
 
phpstan.neon
phpstan.neon
 
 
readme.md
readme.md
 
 

Repository files navigation

Fault

version workflow license

Simple error exception handler

Usage

$error = new Codin\Fault\ErrorHandler();

if ('cli' === php_sapi_name()) {
    $error->attach(new Codin\Fault\Handler\ConsoleHandler());
} else {
    $error->attach(new Codin\Fault\Handler\WebHandler($debug = true));
}

$error->register();

Example with monolog+sentry

$options = [
    'dsn' => '...',
    'environment' => '...',
];
$builder = new Sentry\ClientBuilder(new Sentry\Options($options));
$sentry = new Sentry\State\Hub($builder->getClient());

$logger = new Logger('app');
$logger->pushHandler(new Sentry\Monolog\Handler($sentry, Logger::NOTICE));

$error = new Codin\Fault\ErrorHandler();
$error->attach(new Codin\Fault\Handler\PsrHandler($logger));
$error->register();

About

Basic Error and Exception Handler

Resources

Readme
MIT license
Activity
Custom properties

Stars

2 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.