Added another parameter to assert_parameter to allow specifying a custom error function