That isn't the appropriate error handling: it has a high risk that a missing default value could lead to an invalid URL being generated, rather than an appropriate diagnostic error.