How i can manually Track Errors in react native using appCenter

Viewed 69

I'm not able to find how I can manually send an error using appCenter.

Crashes.trackError not working.No errors sending

can anyone give me a help?

code:

import Crashes, { ErrorAttachmentLog, ExceptionModel } from 'appcenter-crashes';

const generateError = () => {
    try {
        throw ({ error: "Error message" });
        } catch (error) {
        const properties = { 'Category': 'Music', 'Wifi': 'On' };
        const textAttachment = ErrorAttachmentLog.attachmentWithText('Hello text attachment!', 'hello.txt');
        const attachments = [textAttachment];
        const exceptionModel = ExceptionModel.createFromError(error);
        Crashes.trackError(exceptionModel, properties, attachments);
        }
 }

<TouchableOpacity onPress={generateError}>
  <Text>generate Error</Text>
</TouchableOpacity>

package.json:

 "appcenter": "4.3.0",
 "appcenter-analytics": "4.3.0",
 "appcenter-crashes": "4.3.0",

screen appCenter-no errors

0 Answers
Related