handling exceptions in JavaScript

hi

i get an unknown exception which crashes unity. I want to insert a try catch so that i can catch this exception.

the code i use is the following:

try
                {
                    if (texture.LoadImage(System.IO.File.ReadAllBytes(cached_filename)))
                    {
                    }
                    else
                    {
                        return;
                    }
                }
                catch(err : System.Exception)
                {   
                    throw new System.Exception(err.Message);
                     Debug.Log(err.Message);
                }

with this code i get a internal compile error, null ref exception in the catch line but dont know why, can anyone help me?

thanks

The point of throwing an exception is that you catch the exception in the catch block. So putting throw inside catch makes no sense.