negundo-client/src/NativeHandler.php

30 lines
668 B
PHP
Raw Normal View History

2023-03-29 13:52:15 +00:00
<?php
namespace Negundo\Client;
class NativeHandler extends Handler {
public function handleException(\Throwable $ex): array
{
return $this->exceptionHandler->extractExceptionData($ex, $_SERVER, $_POST);
}
2024-03-01 16:48:01 +00:00
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;
}
}
}
2023-03-29 13:52:15 +00:00
}