better handling of failed preview request (e.g. 404) in js plugin