Kirill Simonov avatar Kirill Simonov committed a5b2ff3

Updated encode, compile and serialize error messages.

Comments (0)

Files changed (13)

src/htsql/domain.py

         # Parse `data` as YYYY-DD-MM HH:MM:SS.SSSSSS.
         match = self.regexp.match(data)
         if match is None:
-            raise ValueError("invalid datetime literal: expected a valid time"
-                             " in a 'YYYY-MM-DD HH:SS:MM.SSSSSS' format;"
-                             " got %r" % data.encode('utf-8'))
+            raise ValueError("invalid datetime literal: expected a valid"
+                             " date/time in a 'YYYY-MM-DD HH:SS:MM.SSSSSS'"
+                             " format; got %r" % data.encode('utf-8'))
         year = int(match.group('year'))
         month = int(match.group('month'))
         day = int(match.group('day'))

src/htsql/tr/compile.py

             return self.term
         # Verify that the unit is singular on the term flow.
         if not self.term.flow.spans(self.flow):
-            raise CompileError("expected a singular expression",
+            raise CompileError("a singular expression is expected",
                                self.unit.mark)
         # Inject the unit flow into the term.
         return self.state.inject(self.term, [self.unit.flow])
 
         # Verify that the unit is singular relative to the term.
         if not self.term.flow.spans(self.flow):
-            raise CompileError("expected a singular expression",
+            raise CompileError("a singular expression is expected",
                                self.unit.mark)
         # Extract the unit expressions.
         codes = [unit.code for unit in units]
 
         # Verify that the units are singular relative to the term.
         if not self.term.flow.spans(self.flow):
-            raise CompileError("expected a singular expression",
+            raise CompileError("a singular expression is expected",
                                self.unit.mark)
         # Extract the aggregate expressions.
         codes = [unit.code for unit in units]
         if not self.term.flow.spans(self.flow):
             # This is not reachable: the error is already reported by
             # the wrapping scalar unit.
-            raise CompileError("expected a singular expression",
+            raise CompileError("a singular expression is expected",
                                self.unit.mark)
 
         # The general chain of operations is as follows:
             return self.term
         # Check if the unit is singular against the term flow.
         if not self.term.flow.spans(self.flow):
-            raise CompileError("expected a singular expression",
+            raise CompileError("a singular expression is expected",
                                self.unit.mark)
         # Inject the quotient space -- this should automatically
         # provide the unit.
         if not self.term.flow.spans(self.flow):
             # Not reachable since covering units are never generated
             # by the user directly, only by the compiler.
-            raise CompileError("expected a singular expression",
+            raise CompileError("a singular expression is expected",
                                self.unit.mark)
         # FIXME: the rewritter should optimize the flow graph
         # so that this code is not reachable.

src/htsql/tr/dump.py

         # We assume that the database supports 8-byte signed integer values
         # natively and complain if the value is out of this range.
         if not (-2**63 <= self.value < 2**63):
-            raise SerializeError("invalid integer value",
+            raise SerializeError("integer value is out of range",
                                  self.phrase.mark)
         # Write the number; use `(...)` around a negative number.
         if self.value >= 0:

src/htsql/tr/encode.py

     def __call__(self):
         # The default implementation generates an error.
         # FIXME: a better error message?
-        raise EncodeError("expected a valid code expression",
+        raise EncodeError("a code expression is expected",
                           self.binding.mark)
 
 
     def __call__(self):
         # The default implementation generates an error.
         # FIXME: a better error message?
-        raise EncodeError("expected a valid flow expression",
+        raise EncodeError("a flow expression is expected",
                           self.binding.mark)
 
 
                     if any(flow.dominates(unit.flow) for flow in flows):
                         continue
                     flows = [flow for flow in flows
-                                  if unit.flow.dominates(flow)]
+                                  if not unit.flow.dominates(flow)]
                     flows.append(unit.flow)
                 # More than one dominating flow means the output flow
                 # cannot be inferred from the columns unambiguously.
                 if len(flows) > 1:
-                    raise EncodeError("invalid segment operand",
+                    raise EncodeError("cannot deduce an unambiguous"
+                                      " segment flow",
                                       self.binding.mark)
                 # Otherwise, `flows` contains a single maximal flow node.
                 else:
         seed = self.state.relate(self.binding.seed)
         # Verify that the seed is a plural descendant of the parent flow.
         if base.spans(seed):
-            raise EncodeError("a plural operand is required", seed.mark)
+            raise EncodeError("a plural expression is expected", seed.mark)
         if not seed.spans(base):
-            raise EncodeError("invalid plural operand", seed.mark)
+            raise EncodeError("a valid plural expression is expected",
+                              seed.mark)
         # Encode the kernel expressions.
         kernels = [self.state.encode(binding)
                    for binding in self.binding.kernels]
         kernels = [self.state.encode(binding)
                    for binding in self.binding.kernels]
         # Verify that the kernel is singular against the parent flow.
-        for code in kernels:
-            if not all(seed.spans(unit.flow) for unit in code.units):
-                raise EncodeError("a singular operand is required", code.mark)
+        # FIXME: handled by the compiler.
+        #for code in kernels:
+        #    if not all(seed.spans(unit.flow) for unit in code.units):
+        #        raise EncodeError("a singular expression is expected",
+        #                          code.mark)
         return ForkedFlow(base, seed, kernels, self.binding)
 
 
                   for lbinding, rbinding in self.binding.images]
         # Verify that linking pairs are singular against the parent and
         # the seed flows.
-        for lcode, rcode in images:
-            if not all(base.spans(unit.flow) for unit in lcode.units):
-                raise EncodeError("a singular operand is required", lcode.mark)
-            if not all(seed.spans(unit.flow) for unit in rcode.units):
-                raise EncodeError("a singular operand is required", rcode.mark)
+        # FIXME: don't check as the constraint may be violated after
+        # rewriting; handled by the compiler.
+        #for lcode, rcode in images:
+        #    if not all(base.spans(unit.flow) for unit in lcode.units):
+        #        raise EncodeError("a singular expression is expected",
+        #                          lcode.mark)
+        #    if not all(seed.spans(unit.flow) for unit in rcode.units):
+        #        raise EncodeError("a singular expression is expected",
+        #                          rcode.mark)
         return LinkedFlow(base, seed, images, self.binding)
 
 
             return self.state.encode(self.base)
         # The default implementation complains that the conversion is
         # not admissible.
-        raise EncodeError("inadmissible conversion", self.binding.mark)
+        raise EncodeError("cannot convert a value of type '%s' to '%s'"
+                          % (self.base.domain.family, self.domain.family),
+                          self.binding.mark)
 
 
 class ConvertUntyped(Convert):
 
     def __call__(self):
         # Override in subclasses for formulas that generate flow nodes.
-        raise EncodeError("expected a valid flow expression",
+        raise EncodeError("a flow expression is expected",
                           self.binding.mark)
 
 

src/htsql/tr/flow.py

         # FIXME: this condition could be violated after the rewrite step
         # (also, equal-by-value is not implemented for `Family`):
         #assert base.family == seed.family
-        assert all(base.spans(unit.flow) for code in kernels
-                                          for unit in code.units)
+        # FIXME: we don't check for this constraint in the encoder anymore.
+        #assert all(base.spans(unit.flow) for code in kernels
+        #                                  for unit in code.units)
         assert isinstance(companions, listof(Code))
         ground = seed
         while not ground.is_axis:
         assert seed.spans(base)
         assert not base.spans(seed)
         assert isinstance(images, listof(tupleof(Code, Code)))
-        assert all(base.spans(unit.flow) for lop, rop in images
-                                         for unit in lop.units)
-        assert all(seed.spans(unit.flow) for lop, rop in images
-                                         for unit in rop.units)
+        # FIXME: the constraint may be violated after rewriting.
+        #assert all(base.spans(unit.flow) for lop, rop in images
+        #                                 for unit in lop.units)
+        #assert all(seed.spans(unit.flow) for lop, rop in images
+        #                                 for unit in rop.units)
         assert isinstance(companions, listof(Code))
         ground = seed
         while not base.spans(ground.base):

src/htsql/tr/fn/encode.py

     adapts(AggregateSig)
 
     def aggregate(self, op, flow, plural_flow):
-        plural_units = [unit for unit in op.units
-                             if not flow.spans(unit.flow)]
-        if plural_flow is not None:
-            if flow.spans(plural_flow):
-                raise EncodeError("a plural operand is required", op.mark)
-            if not plural_flow.spans(flow):
-                raise EncodeError("invalid plural operand", op.mark)
-            if not all(plural_flow.spans(unit.flow)
-                       for unit in plural_units):
-                raise EncodeError("invalid plural operand", op.mark)
-            return plural_flow
-        if not plural_units:
-            raise EncodeError("a plural operand is required", op.mark)
-        plural_flows = []
-        for unit in plural_units:
-            if any(plural_flow.dominates(unit.flow)
-                   for plural_flow in plural_flows):
-                continue
-            plural_flows = [plural_flow
-                             for plural_flow in plural_flows
-                             if not unit.flow.dominates(plural_flow)]
-            plural_flows.append(unit.flow)
-        if len(plural_flows) > 1:
-            raise EncodeError("invalid plural operand", op.mark)
-        plural_flow = plural_flows[0]
+        if plural_flow is None:
+            plural_units = [unit for unit in op.units
+                                 if not flow.spans(unit.flow)]
+            if not plural_units:
+                raise EncodeError("a plural operand is expected", op.mark)
+            plural_flows = []
+            for unit in plural_units:
+                if any(plural_flow.dominates(unit.flow)
+                       for plural_flow in plural_flows):
+                    continue
+                plural_flows = [plural_flow
+                                 for plural_flow in plural_flows
+                                 if not unit.flow.dominates(plural_flow)]
+                plural_flows.append(unit.flow)
+            if len(plural_flows) > 1:
+                raise EncodeError("cannot deduce an unambiguous"
+                                  " aggregate flow", op.mark)
+            [plural_flow] = plural_flows
+        if flow.spans(plural_flow):
+            raise EncodeError("a plural operand is expected", op.mark)
         if not plural_flow.spans(flow):
-            raise EncodeError("invalid plural operand", op.mark)
+            raise EncodeError("a valid plural operand is expected",
+                              op.mark)
+        # FIXME: handled by the compiler.
+        #if not all(plural_flow.spans(unit.flow)
+        #           for unit in plural_units):
+        #    raise EncodeError("a valid plural operand is expected",
+        #                      op.mark)
         return plural_flow
 
     def __call__(self):

src/htsql/tr/rewrite.py

         # Verify that the kernel is not scalar.  We can't do it earlier
         # because since unmasking may remove fantom units.
         if all(not code.units for code in kernels):
-            raise EncodeError("an empty or scalar kernel is not allowed",
+            raise EncodeError("an empty or constant kernel is not allowed",
                               self.flow.mark)
         # Unmask the seed against the quotient parent flow.
         seed = self.state.unmask(self.flow.family.seed, mask=self.flow.base)

test/input/error.yaml

   - uri: /max(school{code,name})
     expect: 400
 
+- title: Encode Errors
+  tests:
+  # invalid code expression
+  - uri: /true().fork()
+    expect: 400
+  # invalid flow expression
+  - uri: /true().fork(){true()}
+    expect: 400
+  # invalid segment flow
+  - uri: /school|department
+    expect: 400
+  # singular quotient base
+  - uri: /department.(school^campus)
+    expect: 400
+  # invalid plural quotient base
+  - uri: /department{code, count($school^campus)}
+          :where $school:=school
+    expect: 400
+  # invalid quotient kernel
+  - uri: /school^true()
+    expect: 400
+  # invalid type conversion
+  - uri: /date(true())
+    expect: 400
+  # invalid untyped conversion
+  - uri: /boolean('!')
+    expect: 400
+  - uri: /integer('!')
+    expect: 400
+  - uri: /decimal('!')
+    expect: 400
+  - uri: /float('!')
+    expect: 400
+  - uri: /date('!')
+    expect: 400
+  - uri: /time('!')
+    expect: 400
+  - uri: /datetime('!')
+    expect: 400
+  # invalid aggregate
+  - uri: /department{code, count(school)}
+    expect: 400
+  - uri: /department{code, count(school{code})}
+    expect: 400
+  - uri: /department{code, count($school{code})}
+          :where $school:=school
+    expect: 400
+  - uri: /school{code, count(program|department)}
+    expect: 400
 
+- title: Compile Errors
+  tests:
+  # invalid singular expression
+  - uri: /school{code, department.code}
+    expect: 400
+  - uri: /school{code, department.count(course)}
+    expect: 400
+  - uri: /school{code, department.avg(course.credits)}
+    expect: 400
+  - uri: /school{department^count(course){*}}
+    expect: 400
+  # FIXME: connection error in stitch.py
+
+- title: Serialize Errors
+  tests:
+  # invalid integer value
+  - uri: /18446744073709551616
+    ifndef: [oracle]
+    expect: 400
+
+

test/output/mssql.yaml

           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            compile error: expected a singular expression:
+            compile error: a singular expression is expected:
                 /department{name, course.credits}
                                          ^^^^^^^
         - uri: /department{name, max(course.credits)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: a plural operand is required:
+            encode error: a plural operand is expected:
                 /department{name, count(school)}
                                   ^^^^^^^^^^^^^
         - uri: /max(course.credits)
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'boolean' to 'decimal':
                 /{decimal(true())}
                   ^^^^^^^^^^^^^^^
         - uri: /{float(date('2010-04-15'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'date' to 'float':
                 /{float(date('2010-04-15'))}
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /{integer(string('cinq'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'boolean' to 'date':
                 /{date(true())}
                   ^^^^^^^^^^^^
         - uri: /{date(7)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'integer' to 'date':
                 /{date(7)}
                   ^^^^^^^
         - uri: /{date(time('20:13'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'time' to 'date':
                 /{date(time('20:13'))}
                   ^^^^^^^^^^^^^^^^^^^
         - uri: /{date(string('birthday'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'boolean' to 'time':
                 /{time(true())}
                   ^^^^^^^^^^^^
         - uri: /{time(7)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'integer' to 'time':
                 /{time(7)}
                   ^^^^^^^
         - uri: /{time(date('2010-04-15'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'date' to 'time':
                 /{time(date('2010-04-15'))}
                   ^^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /{time(string('just a moment ago'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'boolean' to 'datetime':
                 /{datetime(true())}
                   ^^^^^^^^^^^^^^^^
         - uri: /{datetime(7)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'integer' to 'datetime':
                 /{datetime(7)}
                   ^^^^^^^^^^^
         - uri: /{datetime(time('20:13'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'time' to 'datetime':
                 /{datetime(time('20:13'))}
                   ^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /{datetime(string('just a moment ago'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: a plural operand is required:
+            encode error: a plural operand is expected:
                 /{exists(true())}
                          ^^^^^^
         - uri: /{every(true())}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: a plural operand is required:
+            encode error: a plural operand is expected:
                 /{every(true())}
                         ^^^^^^
         - uri: /{count(true())}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: a plural operand is required:
+            encode error: a plural operand is expected:
                 /{count(true())}
                   ^^^^^^^^^^^^^
         - uri: /course{no,credits}?department_code='be'
             headers:
             - [Content-Type, text/plain; charset=UTF-8]
             body: |
-              compile error: expected a singular expression:
+              compile error: a singular expression is expected:
                   /school{code,department.exists(course)}
                                           ^^^^^^^^^^^^^^
           - uri: /school{code,department.avg(course.credits)}
             headers:
             - [Content-Type, text/plain; charset=UTF-8]
             body: |
-              compile error: expected a singular expression:
+              compile error: a singular expression is expected:
                   /school{code,department.avg(course.credits)}
                                           ^^^^^^^^^^^^^^^^^^^
           - uri: /department{sum(course.credits),count(course.credits), avg(course.credits)}?exists(course)
             headers:
             - [Content-Type, text/plain; charset=UTF-8]
             body: |
-              compile error: expected a singular expression:
+              compile error: a singular expression is expected:
                   /{(school^campus).campus}
                                     ^^^^^^
       - id: known-issues
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{}{true()}
                  ^^^^^^^^^
         - uri: /school^{true()}{true()}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{true()}{true()}
                  ^^^^^^^^^^^^^^^
         - uri: /school?false()^{true()}{true()}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school?false()^{true()}{true()}
                  ^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /school^{}{*, count(school)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{}{*, count(school)}
                  ^^^^^^^^^
         - uri: /school^{true()}{*, count(school)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{true()}{*, count(school)}
                  ^^^^^^^^^^^^^^^
         - uri: /school?false()^{true()}{*, count(school)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school?false()^{true()}{*, count(school)}
                  ^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /school^{null()}{*, count(school)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{null()}{*, count(school)}
                  ^^^^^^^^^^^^^^^
         - uri: /{school^{}{count(school)}, school?false()^{}{count(school)}}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /{school^{}{count(school)}, school?false()^{}{count(school)}}
                   ^^^^^^^^^
         - uri: /school{program^{}{count(program)}, program?false()^{}{count(program)}}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school{program^{}{count(program)}, program?false()^{}{count(program)}}
                         ^^^^^^^^^^
         - uri: /{count(school^true()), count(school?false()^true()), count(school^null())}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /{count(school^true()), count(school?false()^true()), count(school^null())}
                         ^^^^^^^^^^^^^
         - uri: /(school^null()).^
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /(school^null()).^
                   ^^^^^^^^^^^^^
         - uri: /department^school_code{school_code.name, name}
             bind error: function 'max' expects 1 argument; got 2:
                 /max(school{code,name})
                      ^^^^^^^^^^^^^^^^^
+      - id: encode-errors
+        tests:
+        - uri: /true().fork()
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a code expression is expected:
+                /true().fork()
+                        ^^^^^^
+        - uri: /true().fork(){true()}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a flow expression is expected:
+                /true().fork(){true()}
+                 ^^^^^^
+        - uri: /school|department
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: cannot deduce an unambiguous segment flow:
+                /school|department
+                ^^^^^^^^^^^^^^^^^^
+        - uri: /department.(school^campus)
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a plural expression is expected:
+                /department.(school^campus)
+                             ^^^^^^
+        - uri: /department{code, count($school^campus)} :where $school:=school
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a valid plural expression is expected:
+                /department{code, count($school^campus)} :where $school:=school
+                                                                         ^^^^^^
+        - uri: /school^true()
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: an empty or constant kernel is not allowed:
+                /school^true()
+                 ^^^^^^^^^^^^^
+        - uri: /date(true())
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: cannot convert a value of type 'boolean' to 'date':
+                /date(true())
+                 ^^^^^^^^^^^^
+        - uri: /boolean('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid Boolean literal: expected 'true' or 'false'; got '!':
+                /boolean('!')
+                 ^^^^^^^^^^^^
+        - uri: /integer('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid integer literal: expected an integer in a decimal format; got '!':
+                /integer('!')
+                 ^^^^^^^^^^^^
+        - uri: /decimal('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid decimal literal: !:
+                /decimal('!')
+                 ^^^^^^^^^^^^
+        - uri: /float('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid float literal: !:
+                /float('!')
+                 ^^^^^^^^^^
+        - uri: /date('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid date literal: expected a valid date in a 'YYYY-MM-DD' format; got '!':
+                /date('!')
+                 ^^^^^^^^^
+        - uri: /time('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid time literal: expected a valid time in a 'HH:SS:MM.SSSSSS' format; got '!':
+                /time('!')
+                 ^^^^^^^^^
+        - uri: /datetime('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid datetime literal: expected a valid date/time in a 'YYYY-MM-DD HH:SS:MM.SSSSSS' format; got '!':
+                /datetime('!')
+                 ^^^^^^^^^^^^^
+        - uri: /department{code, count(school)}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a plural operand is expected:
+                /department{code, count(school)}
+                                  ^^^^^^^^^^^^^
+        - uri: /department{code, count(school{code})}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a plural operand is expected:
+                /department{code, count(school{code})}
+                                  ^^^^^^^^^^^^^^^^^^^
+        - uri: /department{code, count($school{code})} :where $school:=school
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a valid plural operand is expected:
+                /department{code, count($school{code})} :where $school:=school
+                                  ^^^^^^^^^^^^^^^^^^^^
+        - uri: /school{code, count(program|department)}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: cannot deduce an unambiguous aggregate flow:
+                /school{code, count(program|department)}
+                              ^^^^^^^^^^^^^^^^^^^^^^^^^
+      - id: compile-errors
+        tests:
+        - uri: /school{code, department.code}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            compile error: a singular expression is expected:
+                /school{code, department.code}
+                                         ^^^^
+        - uri: /school{code, department.count(course)}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            compile error: a singular expression is expected:
+                /school{code, department.count(course)}
+                                         ^^^^^^^^^^^^^
+        - uri: /school{code, department.avg(course.credits)}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            compile error: a singular expression is expected:
+                /school{code, department.avg(course.credits)}
+                                         ^^^^^^^^^^^^^^^^^^^
+        - uri: /school{department^count(course){*}}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            compile error: a singular expression is expected:
+                /school{department^count(course){*}}
+                                                 ^
+      - id: serialize-errors
+        tests:
+        - uri: /18446744073709551616
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            serialize error: invalid integer value:
+                /18446744073709551616
+                 ^^^^^^^^^^^^^^^^^^^^

test/output/mysql.yaml

           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            compile error: expected a singular expression:
+            compile error: a singular expression is expected:
                 /department{name, course.credits}
                                          ^^^^^^^
         - uri: /department{name, max(course.credits)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: a plural operand is required:
+            encode error: a plural operand is expected:
                 /department{name, count(school)}
                                   ^^^^^^^^^^^^^
         - uri: /max(course.credits)
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            serialize error: invalid integer value:
+            serialize error: integer value is out of range:
                 /{18446744073709551616}
                   ^^^^^^^^^^^^^^^^^^^^
         - uri: /{1.0, -2.5, 0.875}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'boolean' to 'decimal':
                 /{decimal(true())}
                   ^^^^^^^^^^^^^^^
         - uri: /{float(date('2010-04-15'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'date' to 'float':
                 /{float(date('2010-04-15'))}
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /{integer(string('zero'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'boolean' to 'date':
                 /{date(true())}
                   ^^^^^^^^^^^^
         - uri: /{date(7)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'integer' to 'date':
                 /{date(7)}
                   ^^^^^^^
         - uri: /{date(time('20:13'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'time' to 'date':
                 /{date(time('20:13'))}
                   ^^^^^^^^^^^^^^^^^^^
         - uri: /{date(string('birthday')), date(string('2010-13-07'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'boolean' to 'time':
                 /{time(true())}
                   ^^^^^^^^^^^^
         - uri: /{time(7)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'integer' to 'time':
                 /{time(7)}
                   ^^^^^^^
         - uri: /{time(date('2010-04-15'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'date' to 'time':
                 /{time(date('2010-04-15'))}
                   ^^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /{time(string('just a moment ago')), time(string('29:04'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'boolean' to 'datetime':
                 /{datetime(true())}
                   ^^^^^^^^^^^^^^^^
         - uri: /{datetime(7)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'integer' to 'datetime':
                 /{datetime(7)}
                   ^^^^^^^^^^^
         - uri: /{datetime(time('20:13'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'time' to 'datetime':
                 /{datetime(time('20:13'))}
                   ^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /{datetime(string('just a moment ago')), datetime(string('2010-13-07
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: a plural operand is required:
+            encode error: a plural operand is expected:
                 /{exists(true())}
                          ^^^^^^
         - uri: /{every(true())}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: a plural operand is required:
+            encode error: a plural operand is expected:
                 /{every(true())}
                         ^^^^^^
         - uri: /{count(true())}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: a plural operand is required:
+            encode error: a plural operand is expected:
                 /{count(true())}
                   ^^^^^^^^^^^^^
         - uri: /course{no,credits}?department_code='be'
             headers:
             - [Content-Type, text/plain; charset=UTF-8]
             body: |
-              compile error: expected a singular expression:
+              compile error: a singular expression is expected:
                   /school{code,department.exists(course)}
                                           ^^^^^^^^^^^^^^
           - uri: /school{code,department.avg(course.credits)}
             headers:
             - [Content-Type, text/plain; charset=UTF-8]
             body: |
-              compile error: expected a singular expression:
+              compile error: a singular expression is expected:
                   /school{code,department.avg(course.credits)}
                                           ^^^^^^^^^^^^^^^^^^^
           - uri: /department{sum(course.credits),count(course.credits), avg(course.credits)}?exists(course)
             headers:
             - [Content-Type, text/plain; charset=UTF-8]
             body: |
-              compile error: expected a singular expression:
+              compile error: a singular expression is expected:
                   /{(school^campus).campus}
                                     ^^^^^^
       - id: known-issues
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{}{true()}
                  ^^^^^^^^^
         - uri: /school^{true()}{true()}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{true()}{true()}
                  ^^^^^^^^^^^^^^^
         - uri: /school?false()^{true()}{true()}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school?false()^{true()}{true()}
                  ^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /school^{}{*, count(school)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{}{*, count(school)}
                  ^^^^^^^^^
         - uri: /school^{true()}{*, count(school)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{true()}{*, count(school)}
                  ^^^^^^^^^^^^^^^
         - uri: /school?false()^{true()}{*, count(school)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school?false()^{true()}{*, count(school)}
                  ^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /school^{null()}{*, count(school)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{null()}{*, count(school)}
                  ^^^^^^^^^^^^^^^
         - uri: /{school^{}{count(school)}, school?false()^{}{count(school)}}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /{school^{}{count(school)}, school?false()^{}{count(school)}}
                   ^^^^^^^^^
         - uri: /school{program^{}{count(program)}, program?false()^{}{count(program)}}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school{program^{}{count(program)}, program?false()^{}{count(program)}}
                         ^^^^^^^^^^
         - uri: /{count(school^true()), count(school?false()^true()), count(school^null())}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /{count(school^true()), count(school?false()^true()), count(school^null())}
                         ^^^^^^^^^^^^^
         - uri: /(school^null()).^
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /(school^null()).^
                   ^^^^^^^^^^^^^
         - uri: /department^school_code{school_code.name, name}
             bind error: function 'max' expects 1 argument; got 2:
                 /max(school{code,name})
                      ^^^^^^^^^^^^^^^^^
+      - id: encode-errors
+        tests:
+        - uri: /true().fork()
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a code expression is expected:
+                /true().fork()
+                        ^^^^^^
+        - uri: /true().fork(){true()}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a flow expression is expected:
+                /true().fork(){true()}
+                 ^^^^^^
+        - uri: /school|department
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: cannot deduce an unambiguous segment flow:
+                /school|department
+                ^^^^^^^^^^^^^^^^^^
+        - uri: /department.(school^campus)
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a plural expression is expected:
+                /department.(school^campus)
+                             ^^^^^^
+        - uri: /department{code, count($school^campus)} :where $school:=school
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a valid plural expression is expected:
+                /department{code, count($school^campus)} :where $school:=school
+                                                                         ^^^^^^
+        - uri: /school^true()
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: an empty or constant kernel is not allowed:
+                /school^true()
+                 ^^^^^^^^^^^^^
+        - uri: /date(true())
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: cannot convert a value of type 'boolean' to 'date':
+                /date(true())
+                 ^^^^^^^^^^^^
+        - uri: /boolean('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid Boolean literal: expected 'true' or 'false'; got '!':
+                /boolean('!')
+                 ^^^^^^^^^^^^
+        - uri: /integer('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid integer literal: expected an integer in a decimal format; got '!':
+                /integer('!')
+                 ^^^^^^^^^^^^
+        - uri: /decimal('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid decimal literal: !:
+                /decimal('!')
+                 ^^^^^^^^^^^^
+        - uri: /float('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid float literal: !:
+                /float('!')
+                 ^^^^^^^^^^
+        - uri: /date('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid date literal: expected a valid date in a 'YYYY-MM-DD' format; got '!':
+                /date('!')
+                 ^^^^^^^^^
+        - uri: /time('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid time literal: expected a valid time in a 'HH:SS:MM.SSSSSS' format; got '!':
+                /time('!')
+                 ^^^^^^^^^
+        - uri: /datetime('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid datetime literal: expected a valid date/time in a 'YYYY-MM-DD HH:SS:MM.SSSSSS' format; got '!':
+                /datetime('!')
+                 ^^^^^^^^^^^^^
+        - uri: /department{code, count(school)}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a plural operand is expected:
+                /department{code, count(school)}
+                                  ^^^^^^^^^^^^^
+        - uri: /department{code, count(school{code})}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a plural operand is expected:
+                /department{code, count(school{code})}
+                                  ^^^^^^^^^^^^^^^^^^^
+        - uri: /department{code, count($school{code})} :where $school:=school
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a valid plural operand is expected:
+                /department{code, count($school{code})} :where $school:=school
+                                  ^^^^^^^^^^^^^^^^^^^^
+        - uri: /school{code, count(program|department)}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: cannot deduce an unambiguous aggregate flow:
+                /school{code, count(program|department)}
+                              ^^^^^^^^^^^^^^^^^^^^^^^^^
+      - id: compile-errors
+        tests:
+        - uri: /school{code, department.code}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            compile error: a singular expression is expected:
+                /school{code, department.code}
+                                         ^^^^
+        - uri: /school{code, department.count(course)}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            compile error: a singular expression is expected:
+                /school{code, department.count(course)}
+                                         ^^^^^^^^^^^^^
+        - uri: /school{code, department.avg(course.credits)}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            compile error: a singular expression is expected:
+                /school{code, department.avg(course.credits)}
+                                         ^^^^^^^^^^^^^^^^^^^
+        - uri: /school{department^count(course){*}}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            compile error: a singular expression is expected:
+                /school{department^count(course){*}}
+                                                 ^
+      - id: serialize-errors
+        tests:
+        - uri: /18446744073709551616
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            serialize error: integer value is out of range:
+                /18446744073709551616
+                 ^^^^^^^^^^^^^^^^^^^^

test/output/oracle.yaml

           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            compile error: expected a singular expression:
+            compile error: a singular expression is expected:
                 /department{name, course.credits}
                                          ^^^^^^^
         - uri: /department{name, max(course.credits)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: a plural operand is required:
+            encode error: a plural operand is expected:
                 /department{name, count(school)}
                                   ^^^^^^^^^^^^^
         - uri: /max(course.credits)
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'boolean' to 'decimal':
                 /{decimal(true())}
                   ^^^^^^^^^^^^^^^
         - uri: /{float(date('2010-04-15'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'date' to 'float':
                 /{float(date('2010-04-15'))}
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /{integer(string('cinq'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'boolean' to 'date':
                 /{date(true())}
                   ^^^^^^^^^^^^
         - uri: /{date(7)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'integer' to 'date':
                 /{date(7)}
                   ^^^^^^^
         - uri: /{date(time('20:13'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'time' to 'date':
                 /{date(time('20:13'))}
                   ^^^^^^^^^^^^^^^^^^^
         - uri: /{date(string('birthday'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'boolean' to 'time':
                 /{time(true())}
                   ^^^^^^^^^^^^
         - uri: /{time(7)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'integer' to 'time':
                 /{time(7)}
                   ^^^^^^^
         - uri: /{time(date('2010-04-15'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'date' to 'time':
                 /{time(date('2010-04-15'))}
                   ^^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /{time(string('just a moment ago'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'boolean' to 'datetime':
                 /{datetime(true())}
                   ^^^^^^^^^^^^^^^^
         - uri: /{datetime(7)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'integer' to 'datetime':
                 /{datetime(7)}
                   ^^^^^^^^^^^
         - uri: /{datetime(time('20:13'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'time' to 'datetime':
                 /{datetime(time('20:13'))}
                   ^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /{datetime(string('just a moment ago'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: a plural operand is required:
+            encode error: a plural operand is expected:
                 /{exists(true())}
                          ^^^^^^
         - uri: /{every(true())}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: a plural operand is required:
+            encode error: a plural operand is expected:
                 /{every(true())}
                         ^^^^^^
         - uri: /{count(true())}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: a plural operand is required:
+            encode error: a plural operand is expected:
                 /{count(true())}
                   ^^^^^^^^^^^^^
         - uri: /course{no,credits}?department_code='be'
             headers:
             - [Content-Type, text/plain; charset=UTF-8]
             body: |
-              compile error: expected a singular expression:
+              compile error: a singular expression is expected:
                   /school{code,department.exists(course)}
                                           ^^^^^^^^^^^^^^
           - uri: /school{code,department.avg(course.credits)}
             headers:
             - [Content-Type, text/plain; charset=UTF-8]
             body: |
-              compile error: expected a singular expression:
+              compile error: a singular expression is expected:
                   /school{code,department.avg(course.credits)}
                                           ^^^^^^^^^^^^^^^^^^^
           - uri: /department{sum(course.credits),count(course.credits), avg(course.credits)}?exists(course)
             headers:
             - [Content-Type, text/plain; charset=UTF-8]
             body: |
-              compile error: expected a singular expression:
+              compile error: a singular expression is expected:
                   /{(school^campus).campus}
                                     ^^^^^^
       - id: known-issues
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{}{true()}
                  ^^^^^^^^^
         - uri: /school^{true()}{true()}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{true()}{true()}
                  ^^^^^^^^^^^^^^^
         - uri: /school?false()^{true()}{true()}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school?false()^{true()}{true()}
                  ^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /school^{}{*, count(school)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{}{*, count(school)}
                  ^^^^^^^^^
         - uri: /school^{true()}{*, count(school)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{true()}{*, count(school)}
                  ^^^^^^^^^^^^^^^
         - uri: /school?false()^{true()}{*, count(school)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school?false()^{true()}{*, count(school)}
                  ^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /school^{null()}{*, count(school)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{null()}{*, count(school)}
                  ^^^^^^^^^^^^^^^
         - uri: /{school^{}{count(school)}, school?false()^{}{count(school)}}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /{school^{}{count(school)}, school?false()^{}{count(school)}}
                   ^^^^^^^^^
         - uri: /school{program^{}{count(program)}, program?false()^{}{count(program)}}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school{program^{}{count(program)}, program?false()^{}{count(program)}}
                         ^^^^^^^^^^
         - uri: /{count(school^true()), count(school?false()^true()), count(school^null())}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /{count(school^true()), count(school?false()^true()), count(school^null())}
                         ^^^^^^^^^^^^^
         - uri: /(school^null()).^
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /(school^null()).^
                   ^^^^^^^^^^^^^
         - uri: /department^school_code{school_code.name, name}
             bind error: function 'max' expects 1 argument; got 2:
                 /max(school{code,name})
                      ^^^^^^^^^^^^^^^^^
+      - id: encode-errors
+        tests:
+        - uri: /true().fork()
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a code expression is expected:
+                /true().fork()
+                        ^^^^^^
+        - uri: /true().fork(){true()}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a flow expression is expected:
+                /true().fork(){true()}
+                 ^^^^^^
+        - uri: /school|department
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: cannot deduce an unambiguous segment flow:
+                /school|department
+                ^^^^^^^^^^^^^^^^^^
+        - uri: /department.(school^campus)
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a plural expression is expected:
+                /department.(school^campus)
+                             ^^^^^^
+        - uri: /department{code, count($school^campus)} :where $school:=school
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a valid plural expression is expected:
+                /department{code, count($school^campus)} :where $school:=school
+                                                                         ^^^^^^
+        - uri: /school^true()
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: an empty or constant kernel is not allowed:
+                /school^true()
+                 ^^^^^^^^^^^^^
+        - uri: /date(true())
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: cannot convert a value of type 'boolean' to 'date':
+                /date(true())
+                 ^^^^^^^^^^^^
+        - uri: /boolean('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid Boolean literal: expected 'true' or 'false'; got '!':
+                /boolean('!')
+                 ^^^^^^^^^^^^
+        - uri: /integer('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid integer literal: expected an integer in a decimal format; got '!':
+                /integer('!')
+                 ^^^^^^^^^^^^
+        - uri: /decimal('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid decimal literal: !:
+                /decimal('!')
+                 ^^^^^^^^^^^^
+        - uri: /float('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid float literal: !:
+                /float('!')
+                 ^^^^^^^^^^
+        - uri: /date('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid date literal: expected a valid date in a 'YYYY-MM-DD' format; got '!':
+                /date('!')
+                 ^^^^^^^^^
+        - uri: /time('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid time literal: expected a valid time in a 'HH:SS:MM.SSSSSS' format; got '!':
+                /time('!')
+                 ^^^^^^^^^
+        - uri: /datetime('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid datetime literal: expected a valid date/time in a 'YYYY-MM-DD HH:SS:MM.SSSSSS' format; got '!':
+                /datetime('!')
+                 ^^^^^^^^^^^^^
+        - uri: /department{code, count(school)}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a plural operand is expected:
+                /department{code, count(school)}
+                                  ^^^^^^^^^^^^^
+        - uri: /department{code, count(school{code})}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a plural operand is expected:
+                /department{code, count(school{code})}
+                                  ^^^^^^^^^^^^^^^^^^^
+        - uri: /department{code, count($school{code})} :where $school:=school
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a valid plural operand is expected:
+                /department{code, count($school{code})} :where $school:=school
+                                  ^^^^^^^^^^^^^^^^^^^^
+        - uri: /school{code, count(program|department)}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: cannot deduce an unambiguous aggregate flow:
+                /school{code, count(program|department)}
+                              ^^^^^^^^^^^^^^^^^^^^^^^^^
+      - id: compile-errors
+        tests:
+        - uri: /school{code, department.code}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            compile error: a singular expression is expected:
+                /school{code, department.code}
+                                         ^^^^
+        - uri: /school{code, department.count(course)}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            compile error: a singular expression is expected:
+                /school{code, department.count(course)}
+                                         ^^^^^^^^^^^^^
+        - uri: /school{code, department.avg(course.credits)}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            compile error: a singular expression is expected:
+                /school{code, department.avg(course.credits)}
+                                         ^^^^^^^^^^^^^^^^^^^
+        - uri: /school{department^count(course){*}}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            compile error: a singular expression is expected:
+                /school{department^count(course){*}}
+                                                 ^

test/output/pgsql.yaml

           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            compile error: expected a singular expression:
+            compile error: a singular expression is expected:
                 /department{name, course.credits}
                                          ^^^^^^^
         - uri: /department{name, max(course.credits)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: a plural operand is required:
+            encode error: a plural operand is expected:
                 /department{name, count(school)}
                                   ^^^^^^^^^^^^^
         - uri: /max(course.credits)
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            serialize error: invalid integer value:
+            serialize error: integer value is out of range:
                 /{18446744073709551616}
                   ^^^^^^^^^^^^^^^^^^^^
         - uri: /{1.0, -2.5, 0.875}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'boolean' to 'decimal':
                 /{decimal(true())}
                   ^^^^^^^^^^^^^^^
         - uri: /{float(date('2010-04-15'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'date' to 'float':
                 /{float(date('2010-04-15'))}
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /{integer(string('cinq'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'boolean' to 'date':
                 /{date(true())}
                   ^^^^^^^^^^^^
         - uri: /{date(7)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'integer' to 'date':
                 /{date(7)}
                   ^^^^^^^
         - uri: /{date(time('20:13'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'time' to 'date':
                 /{date(time('20:13'))}
                   ^^^^^^^^^^^^^^^^^^^
         - uri: /{date(string('birthday'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'boolean' to 'time':
                 /{time(true())}
                   ^^^^^^^^^^^^
         - uri: /{time(7)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'integer' to 'time':
                 /{time(7)}
                   ^^^^^^^
         - uri: /{time(date('2010-04-15'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'date' to 'time':
                 /{time(date('2010-04-15'))}
                   ^^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /{time(string('just a moment ago'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'boolean' to 'datetime':
                 /{datetime(true())}
                   ^^^^^^^^^^^^^^^^
         - uri: /{datetime(7)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'integer' to 'datetime':
                 /{datetime(7)}
                   ^^^^^^^^^^^
         - uri: /{datetime(time('20:13'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: inadmissible conversion:
+            encode error: cannot convert a value of type 'time' to 'datetime':
                 /{datetime(time('20:13'))}
                   ^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /{datetime(string('just a moment ago'))}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: a plural operand is required:
+            encode error: a plural operand is expected:
                 /{exists(true())}
                          ^^^^^^
         - uri: /{every(true())}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: a plural operand is required:
+            encode error: a plural operand is expected:
                 /{every(true())}
                         ^^^^^^
         - uri: /{count(true())}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: a plural operand is required:
+            encode error: a plural operand is expected:
                 /{count(true())}
                   ^^^^^^^^^^^^^
         - uri: /course{no,credits}?department_code='be'
             headers:
             - [Content-Type, text/plain; charset=UTF-8]
             body: |
-              compile error: expected a singular expression:
+              compile error: a singular expression is expected:
                   /school{code,department.exists(course)}
                                           ^^^^^^^^^^^^^^
           - uri: /school{code,department.avg(course.credits)}
             headers:
             - [Content-Type, text/plain; charset=UTF-8]
             body: |
-              compile error: expected a singular expression:
+              compile error: a singular expression is expected:
                   /school{code,department.avg(course.credits)}
                                           ^^^^^^^^^^^^^^^^^^^
           - uri: /department{sum(course.credits),count(course.credits), avg(course.credits)}?exists(course)
             headers:
             - [Content-Type, text/plain; charset=UTF-8]
             body: |
-              compile error: expected a singular expression:
+              compile error: a singular expression is expected:
                   /{(school^campus).campus}
                                     ^^^^^^
       - id: known-issues
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{}{true()}
                  ^^^^^^^^^
         - uri: /school^{true()}{true()}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{true()}{true()}
                  ^^^^^^^^^^^^^^^
         - uri: /school?false()^{true()}{true()}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school?false()^{true()}{true()}
                  ^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /school^{}{*, count(school)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{}{*, count(school)}
                  ^^^^^^^^^
         - uri: /school^{true()}{*, count(school)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{true()}{*, count(school)}
                  ^^^^^^^^^^^^^^^
         - uri: /school?false()^{true()}{*, count(school)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school?false()^{true()}{*, count(school)}
                  ^^^^^^^^^^^^^^^^^^^^^^^
         - uri: /school^{null()}{*, count(school)}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school^{null()}{*, count(school)}
                  ^^^^^^^^^^^^^^^
         - uri: /{school^{}{count(school)}, school?false()^{}{count(school)}}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /{school^{}{count(school)}, school?false()^{}{count(school)}}
                   ^^^^^^^^^
         - uri: /school{program^{}{count(program)}, program?false()^{}{count(program)}}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /school{program^{}{count(program)}, program?false()^{}{count(program)}}
                         ^^^^^^^^^^
         - uri: /{count(school^true()), count(school?false()^true()), count(school^null())}
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /{count(school^true()), count(school?false()^true()), count(school^null())}
                         ^^^^^^^^^^^^^
         - uri: /(school^null()).^
           headers:
           - [Content-Type, text/plain; charset=UTF-8]
           body: |
-            encode error: an empty or scalar kernel is not allowed:
+            encode error: an empty or constant kernel is not allowed:
                 /(school^null()).^
                   ^^^^^^^^^^^^^
         - uri: /department^school_code{school_code.name, name}
             bind error: function 'max' expects 1 argument; got 2:
                 /max(school{code,name})
                      ^^^^^^^^^^^^^^^^^
+      - id: encode-errors
+        tests:
+        - uri: /true().fork()
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a code expression is expected:
+                /true().fork()
+                        ^^^^^^
+        - uri: /true().fork(){true()}
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a flow expression is expected:
+                /true().fork(){true()}
+                 ^^^^^^
+        - uri: /school|department
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: cannot deduce an unambiguous segment flow:
+                /school|department
+                ^^^^^^^^^^^^^^^^^^
+        - uri: /department.(school^campus)
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a plural expression is expected:
+                /department.(school^campus)
+                             ^^^^^^
+        - uri: /department{code, count($school^campus)} :where $school:=school
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: a valid plural expression is expected:
+                /department{code, count($school^campus)} :where $school:=school
+                                                                         ^^^^^^
+        - uri: /school^true()
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: an empty or constant kernel is not allowed:
+                /school^true()
+                 ^^^^^^^^^^^^^
+        - uri: /date(true())
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: cannot convert a value of type 'boolean' to 'date':
+                /date(true())
+                 ^^^^^^^^^^^^
+        - uri: /boolean('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid Boolean literal: expected 'true' or 'false'; got '!':
+                /boolean('!')
+                 ^^^^^^^^^^^^
+        - uri: /integer('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid integer literal: expected an integer in a decimal format; got '!':
+                /integer('!')
+                 ^^^^^^^^^^^^
+        - uri: /decimal('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid decimal literal: !:
+                /decimal('!')
+                 ^^^^^^^^^^^^
+        - uri: /float('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid float literal: !:
+                /float('!')
+                 ^^^^^^^^^^
+        - uri: /date('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |
+            encode error: invalid date literal: expected a valid date in a 'YYYY-MM-DD' format; got '!':
+                /date('!')
+                 ^^^^^^^^^
+        - uri: /time('!')
+          status: 400 Bad Request
+          headers:
+          - [Content-Type, text/plain; charset=UTF-8]
+          body: |