Throw an exception for invalid properties if debug mode is enabled