Skip to content

How to send the message in different structure ? #103

@issam-seghir

Description

@issam-seghir

instead of :
if (!foundUser) return next(createError.NotFound("User not found"));

i want to send an object like this :

	if (!foundUser) return next(createError.NotFound(
		{
			field : "email",
			message: "User not found"
		}	
));

// the same as :  res.status(404).json({field:"email", message:"User not found"})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions