Skip to content

Templating errors are not correctly reported in the body when occurring in a data bucket #866

@255kb

Description

@255kb

Describe the bug

Templating errors are not correctly reported in the body when occurring in a data bucket.
Instead

To Reproduce

Use this broken templating in an inline body (second queryParam should be queryParamRaw):

{
  "{{queryParamRaw 'firstKey'}}": "{{faker (queryParam 'firstValue')}}"
}

We get the following error in the body: Error while serving the content: fakerName.split is not a function or its return value is not iterable.

Now, link a databucket instead and use the same content in the data bucket.
The error is still visible in the logs tab:
image
But the body contains an empty JSON object.

Mockoon version:

1.21.0

OS / OS version:

All

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

✅ Done (ready for next release)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions