negundo-client/src/NativeHandler.php

30 lines
668 B
PHP

<?php
namespace Negundo\Client;
class NativeHandler extends Handler {
public function handleException(\Throwable $ex): array
{
return $this->exceptionHandler->extractExceptionData($ex, $_SERVER, $_POST);
}
public function process(callable $callback) : mixed
{
try {
return $callback();
}
catch (\Throwable $ex)
{
$this->pushData($ex);
if ( $this->callback ?? false ) {
return call_user_func_array($this->callback, [ $ex ] );
}
else {
throw $ex;
}
}
}
}