Add a try catch to display the record when DurationField fails

This commit is contained in:
Deluan 2020-04-27 22:46:40 -04:00
parent e871c7daee
commit 069de0f9ea

View File

@ -2,7 +2,12 @@ import React from 'react'
import PropTypes from 'prop-types'
const DurationField = ({ record = {}, source }) => {
return <span>{format(record[source])}</span>
try {
return <span>{format(record[source])}</span>
} catch (e) {
console.log('Error in DurationField !!! record=', record)
throw e
}
}
const format = (d) => {