Throw an exception with message indicating type of http error

@param number $errno
@param string $message
@throws Error
513381
private function handleCurlError($errno, $message)
    {
        switch ($errno) {
            case CURLE_COULDNT_CONNECT:
            case CURLE_COULDNT_RESOLVE_HOST:
            case CURLE_OPERATION_TIMEOUTED:
                $msg = "Could not connect";
                break;
            case CURLE_SSL_CACERT:
            case CURLE_SSL_PEER_CERTIFICATE:
                $msg = "Could not verify SSL certificate.";
                break;
            default:
                $msg = "Unexpected curl error.";
        }

        $msg .= "\n\n(Network error [errno $errno]: $message)";
        throw new \LeaseCloud\Error($msg);
    }
492122
public function errorHandler($errno, $errstr, $errfile, $errline)
    {
        preg_match('/(ORA-)(\d+)/', $errstr, $ora_error);
        if ($ora_error) {
            $this->_last_error = intval($ora_error[2]);
        } else {
            $this->setError($this->_con);
        }
    }
276454
static public function errorHandler($errno, $errstr, $errfile='', $errline=0, $errcontext=array())
    {
        if (!isset(self::$ignore[basename($errfile) . '-' . $errline . '-' . $errno])) {
            $msg = $errstr . ' Line '
                    . $errline
                    . ', '
                    . $errfile;
            self::$logger->debug($msg);
        }

        return true;
    }
1226203
public function customErrorHandler($errno, $errstr) {
		if ($this->_isActive('phpException')) {
			$check = 'phpException';
			$level = $this->_config->getTestLevel($check);
			if ($level === null) {
				$level = WARNING;
			}
			$message = $this->_getMessage('PHP_EXPCEPTION', $errstr);

			$this->_writeError($check, $message, $this->lineNumber, $level);
		}

		/* Don't execute PHP internal error handler */
		return false;
	}
1236245
protected function err($message, $stopExec = false)
    {
        common_Logger::e($message);
        echo $this->out($message, array('color' => 'light_red'));
        
        if($stopExec == true){
            $this->handleError(new Exception($message, 1));
        }
    }
1364041
private function error(string $message, $status = 1)
    {
        $this->printer->printError($message);
        exit($status);
    }
677235
public static function error_handler($number, $message, $file, $line)
    {
        $msg = "$message in $file on line $line";
        if (($number !== E_NOTICE) && ($number < 2048)) {
            self::errorMessage($msg, true);
            self::customErrorMsg();
        }
        return 0;
    }
213421
protected function logException(\Exception $exception, $message)
    {
        if (null !== $this->logger) {
            if (!$exception instanceof HttpExceptionInterface || $exception->getStatusCode() >= 500) {
                $this->logger->critical($message, array('exception' => $exception));
            } else {
                $this->logger->error($message, array('exception' => $exception));
            }
        }
    }
1180693
public function errorHandler($errno, $errstr, $errfile, $errline)
        {
            $errorMsg = $errstr . " (Line: " . $errline . ")";

            if ($errno != E_WARNING && $errno != E_NOTICE && $errno != E_STRICT) {
                throw new Exception($errorMsg, $errno);
            } else {
                return false; // Let PHP handle it
            }
        }
396912
public function sendError($status = self::HTTP_NOT_FOUND, $message = '')
    {
        if (!is_int($status) || $status < 400 || $status > 505) {
            return;
        }
        
        $this->setBody($message, 'error');
        $this->setStatus($status);
        $this->send();
    }
795375
public static function writeError($message = null, $padding = null)
    {
        if ($padding > 0) {
            $message = str_pad($message, $padding, ' ');
        }

        self::stdError($message);
    }
1165220
protected function setError($message, array $lastError = null)
    {
        $this->isError = true;
        $this->errMessage = $message;

        if ($lastError !== null) {
            $this->errMessage .= ': ' . $lastError['message'];
            $this->errFile = $lastError['file'];
            $this->errLine = $lastError['line'];
        }
    }
45173
public static function errorLog(string $message, \Exception $exception)
    {
        $logger = Config::getLogger();
        if ($logger) {
            $logger->error($message, ['exception' => $exception]);
        }
    }
890854
private function raiseException($errorNum)
    {
        $errMessage = isset($this->listError[$errorNum]) ? $this->listError[$errorNum] : 'Unknown Exception';

        throw new \Exception($errMessage, $errorNum);
    }
877727
protected function errorPage($message, $status = 500)
    {
        if ($message instanceof \Exception) {
            $strMessage = $this->getTranslator()->trans(
                "Sorry, an error occured: %msg",
                [ '%msg' => $message->getMessage() ]
            );

            Tlog::getInstance()->addError($strMessage.": ".$message->getTraceAsString());

            $message = $strMessage;
        } else {
            Tlog::getInstance()->addError($message);
        }

        return $this->render(
            'general_error',
            array(
                "error_message" => $message
            ),
            $status
        );
    }
941141
function errnoException(err, syscall, address, port) {
		var errname;
		var message;
		if ((typeof err === 'undefined' ? 'undefined' : _typeof(err)) == 'object') {
			errname = errorCodes[err.number] || err.number;
			message = syscall + ' ' + errname + ' ' + err.message;
		} else {
			errname = err;
			message = syscall + ' ' + errname;
		}
		var e = new Error(message);
		e.code = e.errno = errname;
		e.syscall = syscall;
		if (port) {
			e.port = port;
		}
		if (address) {
			e.address = address;
		}
		return e;
	}
318348
public function _handleError($errno, $errstr, $errfile, $errline, $context=null)
	{
		// process errors based on the error reporting settings
		if (error_reporting() & $errno)
		{
			try
			{
				// bit of a hack to consolidate errors to exceptions
				$message = $this->_errorNumberString($errno).': '.$errstr;
				throw new \ErrorException($message,0,$errno,$errfile,$errline);
			}
			catch(\ErrorException $e)
			{
				$this->_handleException($e);
			}
		}
	}