Write a Python function that takes a filename and raises a custom exception if the file’s extension is not supported. The function should only allow .txt or .csv files.
Example 1:
Input: "data.json"
Output: "Error: File extension not supported."
Example 2:
Input: "data.csv"
Output: "Valid file extension."