Write a Python function that accepts a string representing a date (in the format “YYYY-MM-DD”) and raises custom exceptions for scenarios like an invalid month (greater than 12), invalid day (greater than 31), etc.
Example 1:
Input: "2023-13-20"
Output: "Error: Invalid month."
Example 2:
Input: "2023-11-31"
Output: "Error: Invalid day."