Error handling for preview

Change-Id: I48543b2d54f378d117cb2e812587eaeaf389503f