If you want your method to throw an error, you can do it, of course. It seems that you're question should be "How can I check from code that a configuration key is disabled, so I can conditionally throw an error?"
The answer is: use isConfigurationKeyEnabled(). By the way, use configurationKeyNum() to convert configuration key names to IDs.