#Custom Errors

1 messages · Page 1 of 1 (latest)

foggy shale
#

I was wondering if it is possible to show a more detailed example on the error. For example, when the editors upload an image that is to big, they receive the standard message that an error occurred. Is it possible to modify this standard messages?

maiden ore
#

You can overwrite any of the language resources in Payload using this as an example: https://payloadcms.com/docs/configuration/i18n#configuration-options

That probably isn't the best approach to solve your problem though. I'd have to revisit how file upload validation is performed, but it seems like your example should return a better error without customizing Payload at all.

#

Also changing the language won't improve the logic at all. You can write a custom validation for your upload fields or make a PR to Payload and become a contributor or open a Github discussion where we can better track the feature request.