Standardize Error Messages

Hey there! I’m working on some custom controllers in Strapi, but I’m not sure how to handle errors properly. I want them to match the way errors are handled in the default Strapi setup. Any advice on how to do this would be really helpful. Thanks!

This topic has been created from a Discord post (1229492427694280704) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

import utils from '@strapi/utils'

const { errors: { ApllicationError } } = utils;


throw new ApplicationError

That’s for server

That’s for controller