# ThrowError

> Stop a SearchExpression evaluation by throwing a SearchExceptionEvaluatorException. User writing an evaluator can decide to throw thse exceptions if the parameters passed to evaluation are not valid or if a problem happens during evaluation.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.Search](/engine/6000.5/script-reference/unityeditor/search.md)
* **Assembly:** UnityEditor

## ThrowError(string)

Stop a [SearchExpression](/engine/6000.5/script-reference/unityeditor/search/searchexpression.md) evaluation by throwing a SearchExceptionEvaluatorException. User writing an evaluator can decide to throw thse exceptions if the parameters passed to evaluation are not valid or if a problem happens during evaluation.

```csharp
public void ThrowError(string message)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)):&#x20;

## ThrowError(string, StringView)

Stop a [SearchExpression](/engine/6000.5/script-reference/unityeditor/search/searchexpression.md) evaluation by throwing a SearchExceptionEvaluatorException. User writing an evaluator can decide to throw thse exceptions if the parameters passed to evaluation are not valid or if a problem happens during evaluation.

```csharp
public void ThrowError(string message, StringView errorPosition)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): **** (\[StringView]\(/engine/6000.5/script-reference/unityeditor/search/stringview)):&#x20;
