[frontend] fix broken PDF preview caused by missing error handling GitOrigin-RevId: a7bba8d1b351a53fb20eb670d2ae4c6d215d0d85