fix(main) sendFile callback: add error condition