Improved YASON error handling