Install ThrowableHandler using Composer.
composer require chevere/throwable-handler
Register ThrowableHandler to handle all errors.
use Chevere\ThrowableHandler\ThrowableHandler;
set_error_handler(ThrowableHandler::ERROR_AS_EXCEPTION);
register_shutdown_function(ThrowableHandler::SHUTDOWN_ERROR_AS_EXCEPTION);
Register your exception handler, you can choose:
ThrowableHandler::PLAIN
ThrowableHandler::CONSOLE
ThrowableHandler::HTML
use Chevere\ThrowableHandler\ThrowableHandler;
set_exception_handler(ThrowableHandler::PLAIN);
Documentation is available at chevere.org.
Copyright 2024 Rodolfo Berrios A.
Chevere is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.