public static function register()
    {
        set_error_handler(
            function ($code, $message, $file, $line, $context) {
                if (error_reporting() == 0) {
                    return false;
                }
                ErrorType::forCode($code)->throwException($message, $file, $line, $context);
            }
        );
    }