Skip to content

abortEarrly = false and formatting the return of multiple errors #3008

Open
@TomMiller-mas

Description

@TomMiller-mas

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?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    supportQuestions, discussions, and general support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions