Merge remote-tracking branch 'origin/develop' into fixes-roundup4
This commit is contained in:
commit
74fe330e4a
19 changed files with 646 additions and 503 deletions
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue