Throw proper errors from File class