# errorReceived

> The VideoPlayer uses this callback to report various types of errors.

## Definition

* **Type:** Event
* **Namespace:** [UnityEngine.Video](/engine/6000.6/script-reference/unityengine/video.md)
* **Assembly:** UnityEngine.VideoModule

```csharp
public event VideoPlayer.ErrorEventHandler errorReceived
```

### Remarks

The types of errors the VideoPlayer reports include:

* HTTP connection problems.
* Issues finding the file.
* Unsupported file types.
* Permission issues.
* Runtime issues.

This is useful if you want to log errors and debug so that it’s easier to diagnose issues. You can also use it to implement fallback solutions, for example, you can display an error message or try to play an alternative video.

Additional Resources: [VideoPlayer.ErrorEventHandler](/engine/6000.6/script-reference/unityengine/video/videoplayer/erroreventhandler.md).

### Examples

```csharp
using UnityEngine;
using UnityEngine.Video;

public class ErrorReceivedExample : MonoBehaviour
{
    public VideoPlayer videoPlayer;
    void Start()
    {
        videoPlayer = GetComponent<VideoPlayer>();
        if (videoPlayer != null)
        {
            // When the VideoPlayer detects an error, call this OnErrorReceived function. 
            videoPlayer.errorReceived += OnErrorReceived;
            videoPlayer.Play();
        }
    }

    void OnErrorReceived(VideoPlayer vp, string message)
    {
        Debug.LogError("Error received: " + message);
    }
}
```
