<commit_before><?php

namespace LaravelExtendedErrors;

use Illuminate\Log\LogManager;

class ExtendedLogManager extends LogManager {

    /**
     * Exceptions (logged usin critical log level)
     *
     * @param \Exception $exception
     * @param array $context
     *
     * @return void
     */
    public function exception(\Exception $exception, array $context = []) {
        $context['exception'] = $exception;
        return $this->critical($exception->getMessage(), $context);
    }

}<commit_msg>Fixed crash when passing \TypeError or \Error as $exception<commit_after><?php

namespace LaravelExtendedErrors;

use Illuminate\Log\LogManager;

class ExtendedLogManager extends LogManager {

    /**
     * Exceptions (logged usin critical log level)
     *
     * @param \Exception $exception
     * @param array $context
     *
     * @return void
     */
    public function exception(\Throwable $exception, array $context = []) {
        $context['exception'] = $exception;
        return $this->critical($exception->getMessage(), $context);
    }

}
{'fraction_non_alphanumeric': 0.1193609022556391, 'fraction_numerical': 0.0, 'mean_word_length': 3.111969111969112, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2883581', 'n_tokens_mistral': 292, 'n_tokens_neox': 290, 'n_words': 76}