Skip to content

Commit

Permalink
[#1515] Capturing Errors in TypeAutofield
Browse files Browse the repository at this point in the history
  • Loading branch information
ifirmawan committed May 28, 2024
1 parent 68e7dae commit 830cb9a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/src/form/fields/TypeAutofield.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useEffect, useMemo, useState } from 'react';
import { View } from 'react-native';
import { Input } from '@rneui/themed';
import PropTypes from 'prop-types';
import * as Sentry from '@sentry/react-native';

import { FieldLabel } from '../support';
import styles from '../styles';
Expand Down Expand Up @@ -148,7 +149,8 @@ const strToFunction = (id, fnString, values) => {
// eslint-disable-next-line no-new-func
return new Function(`return ${fnBody}`);
} catch (error) {
// console.error('[ERROR][TypeAutofield]', id, error, fnBody);
Sentry.captureMessage(`[TypeAutofield] ${fnBody}`);
Sentry.captureException(error);
return false;
}
};
Expand Down

0 comments on commit 830cb9a

Please sign in to comment.