Get the first error found for $name. If $name is not supplied,
the very first error is returned.
320107
public function getFirstError($name = null)
    {
        if (!$name) {
            $name = key($this->errors);
        }

        if (!isset($this->errors[$name])) {
            return;
        }

        return current($this->errors[$name]);
    }
747614
def find_first(name)
      bucket = build(name)
      bucket.retrieve
    rescue Error::ForbiddenBucket, Error::NoSuchBucket
      nil
    end
11025
function get_error()
    {
        $err = $this->error;

        // check ldap connection for errors
        if (!$err && $this->ldap->get_error()) {
            $err = array(self::ERROR_SEARCH, $this->ldap->get_error());
        }

        return $err;
    }
1025567
function &get_registered_object($name) {
		if (!isset($this->_reg_objects[$name]))
		$this->_trigger_fatal_error("'$name' is not a registered object");

		if (!is_object($this->_reg_objects[$name][0]))
		$this->_trigger_fatal_error("registered '$name' is not an object");

		return $this->_reg_objects[$name][0];
	}
1175745
protected function findAssignmentByName($name)
    {
        $assignmentFound = collect($this->assignments)->filter(function ($assignment) use ($name) {
            return $assignment->name == $name;
        })->first();
        if ($assignmentFound) return $assignmentFound;
        return null;
    }
878430
public function first($name)
    {
        if (isset($this->files[$name])) {
            return $this->files[$name];
        }

        foreach ($this->files as $key => $file) {
            if (strpos($key, "{$name}[") === 0) {
                return $file;
            }
        }
    }
792005
public function getFinder(string $name)
    {
        return $this->first(function (FinderItem $item) use ($name) {
            return $item->getName() === $name;
        });
    }
647330
public function findByName($name)
    {
        return Arr::first($this->items, function ($key, Contract $skill) use ($name) {
            return $skill->getName() === strtolower($name);
        }, null);
    }
526070
public function __isset($name)
    {
        try {
            return $this->$name !== null;
        } catch (MemberAccessException $e) {
            return false;
        } catch (LeanMapperException $e) {
            if ($this->isDetached() and $e->getCode() === Result::ERROR_MISSING_COLUMN) {
                return false;
            }
            throw $e;
        }
    }
892367
function ByName($name)
    {
        $this->CheckData($name);
        if ($this->row)
            return $this->row[(string)$name];
    }
1003804
protected function getError() {
		if ($this->_error === false) {
			if (is_resource($this->stmt)) {
				$this->_error = @oci_error($this->stmt);
			}
			else {
				$this->_error = @oci_error();
			}
		}

		return $this->_error;
	}
320513
public static function getISOByName($name)
    {
        $data = collect(self::ISOlist());
        return $data->where('name', $name)->first();
    }
702800
function error( $name, $txt, $placement = false )
    {
        $this->ErrorLog[] = array( 'name' => $name,
                                   'text' => $txt,
                                   'placement' => $placement );

        if ( !is_string( $placement ) )
            $placementText = $this->placementText( $placement );
        else
            $placementText = $placement;
        if ( $name != "" )
            $nameText = "eZTemplate:$name";
        else
            $nameText = "eZTemplate";
        eZDebug::writeError( $txt, $nameText . $placementText );
        $hasAppendWarning =& $GLOBALS['eZTemplateHasAppendWarning'];
        $ini = $this->ini();
        if ( $ini->variable( 'ControlSettings', 'DisplayWarnings' ) == 'enabled' )
        {
            if ( !isset( $hasAppendWarning ) or
                 !$hasAppendWarning )
            {
                if ( function_exists( 'eZAppendWarningItem' ) )
                {
                    eZAppendWarningItem( array( 'error' => array( 'type' => 'template',
                                                                  'number' => eZTemplate::FILE_ERRORS ),
                                                'text' => ezpI18n::tr( 'lib/eztemplate', 'Some template errors occurred, see debug for more information.' ) ) );
                    $hasAppendWarning = true;
                }
            }
        }
    }
1106433
public function getFirstError()
    {
        foreach ($this->models as $model) {
            if ($model->hasErrors()) {
                $errors = $model->getFirstErrors();

                return array_shift($errors);
            }
        }

        return false;
    }
523639
public static function getErrorMessage($name)
    {
        $messages = [
            'system'    => 'Unsupported PHP version, please upgrade!' . PHP_EOL .
                           'This library requires PHP version ' . self::$minPHPVersion . ' or newer.',
            'bcmath'    => 'BCMath extension is required!' . PHP_EOL .
                           'Please install the extension or rebuild with "--enable-bcmath" option.',
            'filter'    => 'Filter extensions is required!' . PHP_EOL .
                           'Please install the extension or rebuild with "--enable-filter" option.',
            'hash'      => 'Hash extension is required!' . PHP_EOL .
                           'Please install the extension or rebuild with "--enable-hash" option.',
            'xmlreader' => 'XMLReader extension is required!' . PHP_EOL .
                           'Please install the extension or rebuild with "--enable-xmlreader" option.',
            'xmlwriter' => 'XMLWriter extension is required!' . PHP_EOL .
                           'Please install the extension or rebuild with "--enable-xmlwriter" option.',
            'curl'      => 'cURL interface is selected, but its not installed on your system!' . PHP_EOL .
                           'Please install the extension or select "stream" as your network interface.'
        ];

        if (array_key_exists($name, $messages)) {
            return $messages[$name];
        }

        return '[' . $name . '] Missing project dependency!';
    }
1065177
private function getFormattedErrors($name)
    {
        if (!$this->hasErrors($name)) {
            return '';
        }

        $errors = $this->session->get('errors');

        return $errors->first($this->transformKey($name), '<div class="invalid-feedback">:message</div>');
    }
7982
private function hasErrors($name)
    {
        if (is_null($this->session) || !$this->session->has('errors')) {
            return false;
        }
        // Get errors session
        $errors = $this->getErrorsSession();

        return $errors->has($this->transformKey($name));
    }