[ui] error-proofing table formatters
parent
f75c74a266
commit
3421523585
|
@ -176,15 +176,17 @@
|
|||
return ATTRIBUTE_LABELS[attribute];
|
||||
}
|
||||
|
||||
function formatValue(
|
||||
value: string | number,
|
||||
attribute: string
|
||||
): string | undefined {
|
||||
function formatValue(value: string | number, attribute: string): string {
|
||||
const handler = VALUE_FORMATTERS[attribute];
|
||||
if (handler) {
|
||||
try {
|
||||
return handler(value);
|
||||
} catch (error) {
|
||||
console.warn(`Error while formatting "${value}": ${error}`);
|
||||
}
|
||||
}
|
||||
return String(value);
|
||||
}
|
||||
|
||||
// Optimizations
|
||||
let resolve = [];
|
||||
|
|
Loading…
Reference in New Issue