Merge remote-tracking branch 'origin/develop' into fixes-roundup4

This commit is contained in:
Henry Jameson 2025-02-17 23:38:24 +02:00
commit 74fe330e4a
19 changed files with 646 additions and 503 deletions

View file

@ -1,4 +1,14 @@
import { humanizeErrors } from '../../modules/errors'
import { capitalize } from 'lodash'
function humanizeErrors (errors) {
return Object.entries(errors).reduce((errs, [k, val]) => {
const message = val.reduce((acc, message) => {
const key = capitalize(k.replace(/_/g, ' '))
return acc + [key, message].join(' ') + '. '
}, '')
return [...errs, message]
}, [])
}
export function StatusCodeError (statusCode, body, options, response) {
this.name = 'StatusCodeError'