# SearchQueryError

> Creates a new SearchQueryError.

## Definition

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

## SearchQueryError(int, int, string, SearchContext, SearchProvider, bool, SearchQueryErrorType)

Creates a new SearchQueryError.

```csharp
public SearchQueryError(int index, int length, string reason, SearchContext context, SearchProvider provider, bool fromSearchQuery = true, SearchQueryErrorType type = SearchQueryErrorType.Error)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Index where the error occurred.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Length of the block that was being parsed.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The reason for the error.**** (\[SearchContext]\(/engine/6000.7/script-reference/unityeditor/search/searchcontext)): The context in which this error was logged.**** (\[SearchProvider]\(/engine/6000.7/script-reference/unityeditor/search/searchprovider)): Which search provider logged this error.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Set to true if this error comes from parsing the searchQuery. This will correctly offset the index with respect to the raw text.**** (\[SearchQueryErrorType]\(/engine/6000.7/script-reference/unityeditor/search/searchqueryerrortype)): The type of query error. See [SearchQueryErrorType](/engine/6000.7/script-reference/unityeditor/search/searchqueryerrortype.md). Defaults to [SearchQueryErrorType.Error](/engine/6000.7/script-reference/unityeditor/search/searchqueryerrortype/error.md).

## SearchQueryError(QueryError, SearchContext, SearchProvider, bool)

Creates a new SearchQueryError from an existing [QueryError](/engine/6000.7/script-reference/unityeditor/search/queryerror.md).

```csharp
public SearchQueryError(QueryError error, SearchContext context, SearchProvider provider, bool fromSearchQuery = true)
```

### Parameters

**** (\[QueryError]\(/engine/6000.7/script-reference/unityeditor/search/queryerror)): The original [QueryError](/engine/6000.7/script-reference/unityeditor/search/queryerror.md).**** (\[SearchContext]\(/engine/6000.7/script-reference/unityeditor/search/searchcontext)): The context in which this error was logged.**** (\[SearchProvider]\(/engine/6000.7/script-reference/unityeditor/search/searchprovider)): Which search provider logged this error.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Set to true if this error comes from parsing the searchQuery. This will correctly offset the index with respect to the raw text.
