Throw file upload error, return true if error has been thrown, false if error has been catched

@param int $number
@param string $text
@access public
5901
public function throwError($number, $text = false, $exit = true)
    {
        if ($this->_catchAllErrors || in_array($number, $this->_skipErrorsArray)) {
            return false;
        }

        switch ($number)
        {
            case CKFINDER_CONNECTOR_ERROR_INVALID_REQUEST:
            case CKFINDER_CONNECTOR_ERROR_INVALID_NAME:
            case CKFINDER_CONNECTOR_ERROR_THUMBNAILS_DISABLED:
            case CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED:
                header("HTTP/1.0 403 Forbidden");
                header("X-CKFinder-Error: ". $number);
                break;

            case CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED:
                header("HTTP/1.0 500 Internal Server Error");
                header("X-CKFinder-Error: ".$number);
                break;

            default:
                header("HTTP/1.0 404 Not Found");
                header("X-CKFinder-Error: ". $number);
                break;
        }

        if ($exit) {
            exit;
        }
    }
84204
protected function throwNumberFormatterException(IntlNumberFormatter $intlFormatter, $number): void
    {
        $error_code = $intlFormatter->getErrorCode();
        if (is_scalar($number)) {
            $val = (string) $number;
        } else {
            $val = 'type: ' . gettype($number);
        }
        throw new Exception\RuntimeException(__METHOD__ . " Cannot format value '$val', Intl/NumberFormatter error code: $error_code.");
    }
924315
public function handleError($number, $message, $file, $line, array $context)
    {
        // This avoids silenced (@'ed) errors from being reported.
        if (error_reporting()) {
            $message = "PHP error $number: $message\n\tat $file:$line";
            Logger::get()->error($message);
            $this->handleException(new \RuntimeException($message));
        }
    }
1364507
function error( $text, $position = false )
    {
        if ( $position )
        {
            $str = $position['file'] . ':' . $position['from'][0] . ' C' . $position['from'][1];
            if ( isset( $position['to'] ) )
                $str .= ' -> L' . $position['to'][0] . ' C' . $position['to'][1];
            $str .= ':';
        }
        $str .= $text;
        if ( class_exists( 'ezcli' ) )
        {
            $cli = eZCLI::instance();
            $cli->error( $str );
        }
        else
        {
            eZDebug::writeError( $str, __METHOD__ );
        }
    }
968343
public static function showError(\Throwable $throwable, int $code = 500, $text = 'Internal Server Error')
    {
        if (Config::application('debug')) {
            /* @noinspection PhpUnusedLocalVariableInspection variable uses in 500.php */
            $error = Html::e($throwable);
        }

        header("HTTP/1.1 $code $text");

        $file = $code . '.php';
        $path = __DIR__ . '/../../../../../../application/views/error/';

        /** @noinspection PhpIncludeInspection */
        include file_exists($path . $file) ? $path . $file : __DIR__ . '/views/' . $file;
    }
898499
public function errTrace($text)
    {
        //====================================================================//
        // Build Error Trace
        $trace = (new Exception())->getTrace()[1];

        //====================================================================//
        // Push Error to Log
        return  self::err("ErrLocalTpl", $trace["class"], $trace["function"], $text);
    }
580921
public function parse(string $text) : bool
    {
        $lower = strtolower($text);
        if (! in_array($lower, array_merge(self::TRUE_VALUES, self::FALSE_VALUES)))
            throw new ParseException($this, $text, 0, self::PARSE_ERROR);
        return in_array($lower, self::TRUE_VALUES);
    }
1373019
public function iWaitForTextToDisappear($text)
   {
       $this->spin(function(FeatureContext $context) use ($text) {
           try {
               $context->assertPageContainsText($text);
           }
           catch(\Behat\Mink\Exception\ResponseTextException $e) {
               return true;
           }
           return false;
       });
   }
999012
public function writeError(string $text, string $type = self::ERROR_ERROR) : self
    {
        $this->getErrorOutput()->writeln(sprintf($type, $text));

        return $this;
    }
240537
protected function fail($error = '')
    {
        $this->isFinished = true;
        $this->isSuccess = false;
        $this->error = $error;
    }
912318
static function writeError( $conditionName, $string, $label = "" )
    {
        if ( !eZDebugSetting::isConditionTrue( $conditionName, eZDebug::LEVEL_ERROR ) )
            return false;
        eZDebug::writeError( $string, eZDebugSetting::changeLabel( $conditionName, $label ) );
    }
529067
private function setError($error)
	{
		if (!\is_int($error)) {
			throw new InvalidArgumentException('Upload file error status must be an integer');
		}

		if (!\in_array($error, self::$errors, true)) {
			throw new InvalidArgumentException('Invalid error status for UploadedFile');
		}

		$this->error = $error;
	}
448781
private function writeNumber($number)
    {
        // Truncate
        if (!ftruncate($this->handle, 0)) {
            throw new RuntimeException("Failed to truncate file {$this->path}.");
        }
        // Reset
        if (0 > fseek($this->handle, 0)) {
            throw new RuntimeException("Failed to move pointer at the beginning of the file {$this->path}.");
        }
        // Write
        if (!fwrite($this->handle, $number)) {
            throw new RuntimeException("Failed to write file {$this->path}.");
        }
        // Flush
        if (!fflush($this->handle)) {
            throw new RuntimeException("Failed to flush file {$this->path}.");
        }
        // Unlock
        if (!flock($this->handle, LOCK_UN)) {
            throw new RuntimeException("Failed to unlock file {$this->path}.");
        }
        // Close
        fclose($this->handle);
    }
718463
protected function _write($file, $text) {
		$text = implode(PHP_EOL, $text);
		if ($this->settings['outputToTmp']) {
			$filename = pathinfo($file, PATHINFO_FILENAME);
			if (mb_substr($filename, -1, 1) === '_') {
				return false;
			}
			$file = pathinfo($file, PATHINFO_DIRNAME) . DS . $filename . '_.' . pathinfo($file, PATHINFO_EXTENSION);
		}
		return (bool)file_put_contents($file, $text);
	}
185041
public function on_error( $num, $str, $file, $line, $context = NULL ) {

		$log_context = [];
		if ( $context ) {
			$skip_keys   = array_merge( array_keys( $GLOBALS ), self::$super_globals_keys );
			$skip        = array_fill_keys( $skip_keys, '' );
			$log_context = array_filter( array_diff_key( (array) $context, $skip ) );
		}

		$log_context[ 'file' ] = $file;
		$log_context[ 'line' ] = $line;

		// Log the PHP error.
		do_action(
			\Inpsyde\Wonolog\LOG,
			new Log( $str, self::$errors_level_map[ $num ], Channels::PHP_ERROR, $log_context )
		);

		return FALSE;
	}
280006
public function dontSeeInShellOutput($text)
    {
        $this->debug($this->output);
        \PHPUnit\Framework\Assert::assertNotContains($text, $this->output);
    }
550487
public function setNumber($number)
    {
        if (!is_numeric($number) && $number != null)
        {
            throw new InvalidArgumentException("Number is not numeric.");
        }
        $this->number = preg_replace('/\D/', '', $number);
    }