Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add sentry logs on errors (backport #269) #270

Merged
merged 1 commit into from
Oct 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion App/Screens/About/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export function About (props: AboutProps) {
</Text>
.{'\n'}
{'\n'}
Sh**t! I Smoke v{Constants.manifest.version}.
Sh**t! I Smoke v{Constants.manifest.version} (#{Constants.manifest.revisionId || 'development'}).
</Text>
{/* Add languages https://github.com/amaurymartiny/shoot-i-smoke/issues/73 */}
</View>
Expand Down
11 changes: 9 additions & 2 deletions App/Screens/ErrorScreen/ErrorScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Sh**t! I Smoke. If not, see <http://www.gnu.org/licenses/>.

import React, { useContext } from 'react';
import { Image, StyleSheet, Text, View } from 'react-native';
import React, { useContext, useEffect } from 'react';
import { NavigationInjectedProps } from 'react-navigation';
import { Image, StyleSheet, Text, View } from 'react-native';
import { scale } from 'react-native-size-matters';
import * as Sentry from 'sentry-expo';

import errorPicture from '../../../assets/images/error.png';
import { Button } from '../../components';
Expand All @@ -33,6 +34,12 @@ export function ErrorScreen (props: ErrorScreenProps) {

trackScreen('ERROR');

useEffect(() => {
if (error) {
Sentry.captureException(new Error(error));
}
}, []);

return (
<View style={styles.container}>
<Image source={errorPicture} />
Expand Down
2 changes: 1 addition & 1 deletion App/util/fp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import * as TE from 'fp-ts/lib/TaskEither';
import { pipe } from 'fp-ts/lib/pipeable';
import { capDelay, limitRetries, RetryStatus } from 'retry-ts';
import { retrying } from 'retry-ts/lib/Task';
import Sentry from 'sentry-expo';
import * as Sentry from 'sentry-expo';

import { noop } from './noop';

Expand Down