hapijs / hapijs/joi

abortEarrly = false and formatting the return of multiple errors

Open
#3,008 1 comment 0 reactions 0 assignees View on GitHub
support
Dominant language
JavaScript
Stars
21.2k
Forks
1.5k
Avg merge
4h 57m
Merged PRs (30d)
14

Description

### Runtime

node 18, express 4

### Runtime version

18, 4 latest on both

### Module version

17.7.0"

### Used with

express.js

### Any other relevant information

It seems to daisy chain the errors into one long string. Is there a way to have them on their own line? /n or
added the string of multiple error messages string.

### How can we help?

```js
try {
const inputVal = await schemaGetCustProdQuery.validateAsync(inputData, {
abortEarly: false,
});
return inputVal;
} catch (err) {
return `${err}`.replace("ValidationError:", "Validation Error:");
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.