Improve error handling in FrontMatter parsing