catalyst / moodle-tool_pdfpages

A Moodle plugin for converting web pages to PDFs using various headless browser drivers
3 stars 2 forks source link

Shouldn't throw exception for unsupported options #18

Closed tomdickman closed 3 years ago

tomdickman commented 3 years ago

Currently, converters validate their options and throw an exception if an invalid option is found.

As different converters take various different options, this behaviour may cause unexpected behaviour when we don't know the converter driver which is being used ahead of time, as we are unable to provide options for multiple converters because this will throw an exception, even though this is a valid use case.

Recommend we change this validation to a cleanup function which simply strips options not relevant to the converter instance, allowing for options to be passed for multiple converters without needing to know which converter will be used.