Write a clean parser to handle a custom configuration or data format, ensuring graceful error handling for malformed inputs.