diff --git a/schema.py b/schema.py
index ef5dede..a1ada98 100644
--- a/schema.py
+++ b/schema.py
@@ -220,7 +220,7 @@ class Regex(object):
             if self._pattern.search(data):
                 return data
             else:
-                raise SchemaError("%r does not match %r" % (self, data), e)
+                raise SchemaError("%r does not match %r" % (self, data), e.format(data) if e else None)
         except TypeError:
             raise SchemaError("%r is not string nor buffer" % data, e)
 
@@ -344,7 +344,7 @@ class Schema(object):
     def validate(self, data):
         Schema = self.__class__
         s = self._schema
-        e = self._error.format(data) if self._error else None
+        e = self._error
         i = self._ignore_extra_keys
 
         if isinstance(s, Literal):
@@ -397,7 +397,7 @@ class Schema(object):
                                 except SchemaError as x:
                                     k = "Key '%s' error:" % nkey
                                     message = self._prepend_schema_name(k)
-                                    raise SchemaError([message] + x.autos, [e] + x.errors)
+                                    raise SchemaError([message] + x.autos, [e.format(data) if e else None] + x.errors)
                                 else:
                                     new[nkey] = nvalue
                                     coverage.add(skey)
@@ -408,13 +408,13 @@ class Schema(object):
                 s_missing_keys = ", ".join(repr(k) for k in sorted(missing_keys, key=repr))
                 message = "Missing key%s: %s" % (_plural_s(missing_keys), s_missing_keys)
                 message = self._prepend_schema_name(message)
-                raise SchemaMissingKeyError(message, e)
+                raise SchemaMissingKeyError(message, e.format(data) if e else None)
             if not self._ignore_extra_keys and (len(new) != len(data)):
                 wrong_keys = set(data.keys()) - set(new.keys())
                 s_wrong_keys = ", ".join(repr(k) for k in sorted(wrong_keys, key=repr))
                 message = "Wrong key%s %s in %r" % (_plural_s(wrong_keys), s_wrong_keys, data)
                 message = self._prepend_schema_name(message)
-                raise SchemaWrongKeyError(message, e)
+                raise SchemaWrongKeyError(message, e.format(data) if e else None)
 
             # Apply default-having optionals that haven't been used:
             defaults = set(k for k in s if type(k) is Optional and hasattr(k, "default")) - coverage
@@ -428,36 +428,36 @@ class Schema(object):
             else:
                 message = "%r should be instance of %r" % (data, s.__name__)
                 message = self._prepend_schema_name(message)
-                raise SchemaUnexpectedTypeError(message, e)
+                raise SchemaUnexpectedTypeError(message, e.format(data) if e else None)
         if flavor == VALIDATOR:
             try:
                 return s.validate(data)
             except SchemaError as x:
-                raise SchemaError([None] + x.autos, [e] + x.errors)
+                raise SchemaError([None] + x.autos, [e.format(data) if e else None] + x.errors)
             except BaseException as x:
                 message = "%r.validate(%r) raised %r" % (s, data, x)
                 message = self._prepend_schema_name(message)
-                raise SchemaError(message, e)
+                raise SchemaError(message, e.format(data) if e else None)
         if flavor == CALLABLE:
             f = _callable_str(s)
             try:
                 if s(data):
                     return data
             except SchemaError as x:
-                raise SchemaError([None] + x.autos, [e] + x.errors)
+                raise SchemaError([None] + x.autos, [e.format(data) if e else None] + x.errors)
             except BaseException as x:
                 message = "%s(%r) raised %r" % (f, data, x)
                 message = self._prepend_schema_name(message)
-                raise SchemaError(message, e)
+                raise SchemaError(message, e.format(data) if e else None)
             message = "%s(%r) should evaluate to True" % (f, data)
             message = self._prepend_schema_name(message)
-            raise SchemaError(message, e)
+            raise SchemaError(message, e.format(data) if e else None)
         if s == data:
             return data
         else:
             message = "%r does not match %r" % (s, data)
             message = self._prepend_schema_name(message)
-            raise SchemaError(message, e)
+            raise SchemaError(message, e.format(data) if e else None)
 
     def json_schema(self, schema_id, use_refs=False):
         """Generate a draft-07 JSON schema dict representing the Schema.

diff --git a/test_schema.py b/test_schema.py
index fb7a59f..d8af5e0 100644
--- a/test_schema.py
+++ b/test_schema.py
@@ -1600,3 +1600,18 @@ def test_prepend_schema_name():
         Schema(int, name="custom_schemaname").validate("a")
     except SchemaUnexpectedTypeError as e:
         assert str(e) == "'custom_schemaname' 'a' should be instance of 'int'"
+
+
+def test_dict_literal_error_string():
+    # this is a simplified regression test of the bug in github issue #240
+    assert Schema(Or({"a": 1}, error="error: {}")).is_valid(dict(a=1))
+
+
+def test_callable_error():
+    # this tests for the behavior desired in github pull request #238
+    e = None
+    try:
+        Schema(lambda d: False, error="{}").validate("This is the error message")
+    except SchemaError as ex:
+        e = ex
+    assert e.errors == ["This is the error message"]

Formatting error when supplying raw dict as schema to `Or`
I'm not sure if this is valid Schema usage, but I wanted to drop my reproduction here just in case.

I have a schema that looks like this:

```python
  import schema as s

  test1 = s.Or(str, {
      s.Optional("gpu"): str,
      s.Optional("cpu"): str
  },
               error="Got '{}'")

  test1.validate({"cpu": "face", "gpu": "cake"})
```

Trying to run that code throws this error:

```python
self = Schema(<class 'dict'>), data = {'cpu': 'face', 'gpu': 'cake'}

    def validate(self, data):
      Schema = self.__class__
      s = self._schema
>     e = self._error.format(data) if self._error else None
E     KeyError: "'cpu'"

env/lib/python3.6/site-packages/schema.py:372: KeyError
```

When I trace, it looks like what's happening is that `self._error` on the `Or` schema is getting set to the FILLED schema, on this line:

https://github.com/keleshev/schema/blob/master/schema.py#L345

ie, when I insert `print(self._error)` there, I see:

```python
Got '{}'
Got '{'cpu': 'face', 'gpu': 'cake'}'
```

Which creates this case:

```python
>>> "Got '{'cpu': 'face', 'gpu': 'cake'}'".format({'cpu': 'face', 'gpu': 'cake'})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: "'cpu'"
```

The issue's solved if I wrap the dictionary in `s.Schema`... but it might be worth having `Or`, `And` etc do the wrapping for us if it sees a raw dict to prevent this issue.

Hope this helps!
test_schema.py::test_dict_literal_error_string
test_schema.py::test_copy test_schema.py::test_json_schema test_schema.py::test_json_schema_title_and_description test_schema.py::test_nice_errors test_schema.py::test_json_schema_root_not_dict[input_schema6-enum-expected_value6] test_schema.py::test_json_schema_description_nested test_schema.py::test_or test_schema.py::test_strictly test_schema.py::test_json_schema_and_types test_schema.py::test_json_schema_nested test_schema.py::test_json_schema_root_not_dict[list-type-array] test_schema.py::test_literal_repr test_schema.py::test_json_schema_root_not_dict[input_schema8-allOf-expected_value8] test_schema.py::test_json_schema_types test_schema.py::test_json_schema_additional_properties[input_schema2-False-True] test_schema.py::test_test test_schema.py::test_dict_hook test_schema.py::test_callable_error test_schema.py::test_json_schema_array[input_schema2-type-string] test_schema.py::test_json_schema_default_is_tuple test_schema.py::test_json_schema_or_only_one test_schema.py::test_json_schema_array[input_schema1-const-1] test_schema.py::test_json_schema_object_or_array_of_object test_schema.py::test_json_schema_additional_properties[input_schema4-True-True] test_schema.py::test_json_schema_definitions test_schema.py::test_json_schema_or_values test_schema.py::test_json_schema_array[input_schema0-enum-expected_value0] test_schema.py::test_json_schema_dict_type test_schema.py::test_description_with_default test_schema.py::test_json_schema_root_not_dict[input_schema7-anyOf-expected_value7] test_schema.py::test_ignore_extra_keys_validation_and_return_keys test_schema.py::test_json_schema_optional_key test_schema.py::test_json_schema_and_list test_schema.py::test_or_error_handling test_schema.py::test_json_schema_forbidden_key_ignored test_schema.py::test_json_schema_other_types test_schema.py::test_json_schema_definitions_recursive test_schema.py::test_inheritance test_schema.py::test_list_tuple_set_frozenset test_schema.py::test_json_schema_const_is_none test_schema.py::test_use_json test_schema.py::test_json_schema_with_title test_schema.py::test_use_error_handling test_schema.py::test_json_schema_default_value test_schema.py::test_validate_list test_schema.py::test_description test_schema.py::test_json_schema_additional_properties[input_schema0-False-False] test_schema.py::test_json_schema_nested_schema test_schema.py::test_json_schema_default_value_with_literal test_schema.py::test_json_schema_additional_properties[input_schema3-False-True] test_schema.py::test_json_schema_additional_properties[input_schema1-False-True] test_schema.py::test_prepend_schema_name test_schema.py::test_regex test_schema.py::test_json_schema_default_is_none test_schema.py::test_json_schema_default_is_custom_type test_schema.py::test_validate_file test_schema.py::test_dict_subtypes test_schema.py::test_json_schema_definitions_and_literals test_schema.py::test_json_schema_refs test_schema.py::test_json_schema_refs_no_missing test_schema.py::test_dict_keys test_schema.py::test_json_schema_description_and_nested test_schema.py::test_issue_56_cant_rely_on_callables_to_have_name test_schema.py::test_error_reporting test_schema.py::test_issue_9_prioritized_key_comparison test_schema.py::test_schema_error_handling test_schema.py::test_ignore_extra_keys test_schema.py::test_json_schema_optional_key_nested test_schema.py::test_json_schema_default_is_literal test_schema.py::test_json_schema_root_not_dict[dict-type-object] test_schema.py::test_json_schema_const_is_custom_type test_schema.py::test_and_error_handling test_schema.py::test_json_schema_or_key test_schema.py::test_validate_object test_schema.py::test_issue_9_prioritized_key_comparison_in_dicts test_schema.py::test_missing_keys_exception_with_non_str_dict_keys test_schema.py::test_optional_key_convert_failed_randomly_while_with_another_optional_object test_schema.py::test_json_schema_additional_properties_multiple test_schema.py::test_json_schema_description_or_nested test_schema.py::test_or_only_one test_schema.py::test_json_schema_const_is_callable test_schema.py::test_json_schema_regex_root test_schema.py::test_dict_key_error test_schema.py::test_and test_schema.py::test_dict test_schema.py::test_json_schema_or_values_nested test_schema.py::test_json_schema_root_not_dict[float-type-number] test_schema.py::test_dict_optional_keys test_schema.py::test_issue_83_iterable_validation_return_type test_schema.py::test_dict_optional_defaults test_schema.py::test_dict_forbidden_keys test_schema.py::test_json_schema_root_not_dict[int-type-integer] test_schema.py::test_json_schema_and_simple test_schema.py::test_json_schema_ref_in_list test_schema.py::test_complex test_schema.py::test_json_schema_definitions_invalid test_schema.py::test_schema test_schema.py::test_json_schema_or_one_value test_schema.py::test_schema_repr test_schema.py::test_json_schema_root_not_dict[bool-type-boolean] test_schema.py::test_json_schema_refs_is_smaller test_schema.py::test_json_schema_regex test_schema.py::test_json_schema_definitions_nested test_schema.py::test_exception_handling_with_bad_validators test_schema.py::test_json_schema_literal_with_enum test_schema.py::test_json_schema_or_values_with_optional test_schema.py::test_json_schema_root_not_dict[test-const-test] test_schema.py::test_json_schema_or_types