[frontend] Fix error reporting.