catch exceptions for preview