Well I've never used nor heard of longdesc but W3C says this:
longdesc = uri [CT]
This attribute specifies a link to a long description of the image. This description should supplement the short description provided using the alt attribute. When the image has an associated image map, this attribute should provide information about the image map's contents. This is particularly important for server-side image maps. Since an IMG element may be within the content of an A element, the user agent's mechanism in the user interface for accessing the "longdesc" resource of the former must be different than the mechanism for accessing the href resource of the latter.
It appears that it is also just used when creating websites for the blind to describe beyond what could be said in the alt attribute. Also the longdesc will be phased out in html5. It is still used in html4 and xhtml1
IMHO, I would just use the alt attribute. I have made a website for the blind before and their software pics up the description in the alt attribute. You can use up to 125 characters in the alt attribute.
As for the error it is giving you I would have to see some code.