Skip to Content
0
Feb 07 at 07:18 AM

Incorrect documentation regarding "Error Sanitization"?

214 Views Last edit Feb 07 at 07:20 AM 2 rev

Hello CAP Community,

the documentation on req.error, notify, info, warn (code?, msg, target?, args?) has a section Error Sanitization. There there behaviour of CAP in a production environment ( NODE_ENV=production ) is described. The documentation contains this sentence:

"Errors defined by app developers are not sanitized and returned to the client unchanged."

I've tested the behaviour in my sample project bookshop-demo. When I use (srv/admin-service.js#L689):

req.error

and I run in production, I see the following behaviour:

I select the Order No. 9:

screenshot-2023-02-07-at-080840.png

and click "Check Consistency V4". The Pop-Up is:

screenshot-2023-02-07-at-080847.png

When I test Order No. 7. where the implementation uses req.info but sets numericSeverity = 4 I see this behavour:

screenshot-2023-02-07-at-081230.png

I think the statement "Errors defined by app developers are not sanitized and returned to the client unchanged." isn't correct or?

Best Regards
Gregor

cc: Rene Jeglinsky