get or set err

@param LoggerInterface $err
@return null|string
557248
public function err(LoggerInterface $err = null)
    {
        if (!is_null($err)) {
            $this->err = $err;
        } else {
            return $this->err;
        }
    }
1224531
public function setLoggerInstance(LoggerInterface $LogInterface = null)
    {
        $this->oLog = $LogInterface ?? new \Psr\Log\NullLogger();

        return $this;
    }
105886
func (l *Logger) Err(msg string) error {
	return l.logMsg(nil, LEVEL_ERR, msg)
}
83678
static function format_logline( PLUGError $Err ){
		if( PLUG::is_compiled() ){
			return sprintf(
				'%s: %s: %s', 
				basename(self::arg(0)), 
				$Err->getTypeString(), 
				$Err->getMessage()
			);
		}
		else {
			return sprintf(
				'%s: %s: %s in %s#%u', 
				basename(self::arg(0)), 
				$Err->getTypeString(), 
				$Err->getMessage(), 
				basename($Err->getFile()), 
				$Err->getLine()
			);
		}
	}
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;
    }
1003448
static public function error($errcode = -1, $errmsg=null, $data=null)
    {
        $object = static::instance($errcode, $errmsg, $data);
        if (!$object->get('errcode')) {
            $object->set('errcode', -1);
        }
        return $object;
    }
58307
public function getResponseError(ResponseInterface $response)
    {
        if ($this->isError($response)) {
            $error = $this->getError($response);
            if (in_array($error, ['invalid_token', 'not_allowed_ip'], true)) {
                $this->app->user->logout();
                $this->app->response->refresh()->send();
                $this->app->end();
            }

            return $error ?: 'unknown api error';
        }

        if ($response->getRequest()->getQuery()->action === 'search') {
            $this->fixResponse($response);
        }

        return false;
    }
207587
public function errorHandler($errno, $errstr, $file, $line)
    {
        switch ($errno) {
            case E_USER_ERROR:
            case E_ERROR:
            case E_RECOVERABLE_ERROR:
                $this->logger->addError($errstr, array($file, $line));
                exit();
                break;
            case E_WARNING:
            case E_USER_WARNING:
                $this->logger->addWarning($errstr, array($file, $line));
                break;
            default:
                $this->logger->addInfo($errstr, array($file, $line));
                break;
        }
    }
539403
function log(err) {
    if (_logger) {
      if (typeof(err) == 'string') {
        err = { message: err, code: 0 }
      }
      _logger(err);
    }
  }
324672
public static function errorHandler($errno, $errstr, $errfile = null, $errline = null, array $errcontext = array())
    {
//echo __METHOD__;
        if (!(error_reporting() & $errno)) {
            return;
        }
        self::exceptionHandler(
            new Error($errstr, Response::STATUS_ERROR, $errfile, $errline)
        );
    }
854075
public static function logException (LoggerInterface $logger, Exception $exception)
  {
    $logger->error (sprintf ("%s, at %s(%s)", $exception->getMessage (),
      ErrorConsole::shortFileName ($exception->getFile ()), $exception->getLine ()));
  }
1043940
public static function setErrorHandler($errorHandler)
    {
        # Get the current error handler to make sure it's set,
        # since it will need to be used if the passed error
        # handler is invalid
        $currentErrorHandler = static::getErrorHandler();
        
        if (!($errorHandler instanceof ErrorHandlerInterface)) {
            $message = 'The error handler argument is not valid, because it doesn\'t implement '
                .ErrorHandlerInterface::class.'.';
                $code = ErrorHandlerInterface::INVALID_ARGUMENT;
            $currentErrorHandler->throwException($message, $code);
        } // @codeCoverageIgnore
        self::$errorHandler = $errorHandler;
    }
1311162
private function getStatusCode($error, ResponseInterface $response)
    {
        if ($error instanceof \Throwable && ($error->getCode() >= 400 && $error->getCode() <= 599)) {
            return $error->getCode();
        }

        $status = $response->getStatusCode();
        if (! $status || $status < 400 || $status > 599) {
            $status = 500;
        }
        return $status;
    }
1066356
static function display( PLUGError $Err ){
		$html = ini_get('html_errors');
		if( $html ){
			$s = '<div class="error"><strong>%s:</strong> %s. in <strong>%s</strong> on line <strong>%u</strong></div>';
		}
		else {
			$s = "\n%s: %s. in %s on line %u";
		}
		$args = array ( 
			$s,
			$Err->getTypeString(),
			$Err->getMessage(), 
			$Err->getFile(),
			$Err->getLine()
		);
		// add trace in dev mode
		if( ! PLUG::is_compiled() ){
			$args[0] .= $html ? "\n<pre>%s</pre>" : "\n%s";
			$args[] = $Err->getTraceAsString();
		}
		return call_user_func_array( 'sprintf', $args );
	}
257229
protected function obtainErrorType(int $errSeverity): string
    {
        $errorMap = [
            E_ERROR             => 'Fatal',
            E_CORE_ERROR        => 'Fatal',
            E_USER_ERROR        => 'Fatal',
            E_COMPILE_ERROR     => 'Fatal',
            E_RECOVERABLE_ERROR => 'Fatal',
            E_WARNING           => 'Warning',
            E_CORE_WARNING      => 'Warning',
            E_USER_WARNING      => 'Warning',
            E_COMPILE_WARNING   => 'Warning',
            E_PARSE             => 'Parse',
            E_NOTICE            => 'Notice',
            E_USER_NOTICE       => 'Notice',
            E_STRICT            => 'Strict',
            E_DEPRECATED        => 'Deprecated',
            E_USER_DEPRECATED   => 'Deprecated'
        ];

        //Default value if the error is not found in the map array
        $errType = 'Unknown';
        
        //Search in map array
        if (isset($errorMap[$errSeverity])) {
            $errType = $errorMap[$errSeverity];
        }
        
        return $errType;
    }
788909
private function getMessage($error, ServerRequestInterface $request, ResponseInterface $response)
    {
        if ($error instanceof ApiException) {
            $message = $error->getArrayMessage();
            return !empty($message) ? $message : $error->getMessage();
        }

        if ($error instanceof \Throwable) {
            return $error;
        }

        return 'An error ocurred.';
    }
701790
protected function getErrFunc()
    {
        if (null === $this->errFunc) {
            $this->errFunc = function ($errno, $errstr, $errfile, $errline) {
                $this->stopErrorHandling();
                throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
            };
        }

        return $this->errFunc;
    }