-
-
Notifications
You must be signed in to change notification settings - Fork 337
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
Non-Error exception captured with keys: error #391
Comments
👍 Same here |
Can you link a Sentry event here please? |
Attached a screen shot. |
The next release (which is currently building) should fix this. |
Still got this error: |
Same here; got mine originating from https://github.com/react-native-community/react-native-share/blob/71737360313e35216062036c8a60416dc2aefc80/index.js#L182 and captured it with try {
// my code
} catch (e) {
Sentry.captureException(e);
} Am I capturing this the wrong way? |
@HazAT Here is a link for a similar error ("Error: Non-Error exception captured with keys: errorCode, errorMessage…"): https://sentry.io/share/issue/1d9a134305c747f6a134880e134e51d5/ |
Also still getting this for an angular6 frontend:
EDIT: Sorry - didn't realize this was specific to react-native-sentry |
This is not specific to react-native, i got this on angular 6 application |
@glebmachine Yep, agreed - just this issue is in the |
Hello, I have the same issue with an angular 6 app, my Raven-js version is |
Any updates on this? Happening on angular6 with raven-js 3.26.4. |
Happening on vue2 with "raven-js": "^3.26.4" |
hey,I found the reason in my project,It doesn't matter with the version or framwork. After I modified this, this error has never happened again. |
@lilywang711 I would like to disagree, the error can be an Error, ErrorEvent or string. |
Happens on Reactjs web app too |
same here |
So, if this has occurred, it means that Sentry/Raven doesn't believe the error is an Note that if you're trying to capture a custom For example, @jackrvaughan wrote:
This means that Sentry/Raven encountered a JavaScript object with this shape:
(That doesn't look like an |
on Node
then throw
and I get:
|
I tried this solution getsentry/sentry-javascript#1260 (comment) but still getting something like:
|
I'm not able to reproduce this issue locally. Test code: const Sentry = require("@sentry/node");
Sentry.init({
dsn: "http://[email protected]/42",
beforeSend(event) {
console.log(JSON.stringify(event, null, 2));
return null;
}
});
class AppError extends Error {
constructor(error) {
super(error.err_msg);
this.name = this.constructor.name;
Error.captureStackTrace(this, this.constructor);
}
}
throw new AppError({ err_msg: "test d" }); I also tried direct Sentry.captureException(new AppError({ err_msg: "test d" })); and it worked just fine as well. Logs: {
"exception": {
"values": [
{
"stacktrace": {
"frames": [// removed to not take too much space]
},
"type": "AppError",
"value": "test d"
}
]
},
"message": "AppError: test d",
"extra": {
"AppError": {
"name": "AppError"
}
},
// rest of the event
} Tested on |
happened on vue2.6 with "raven-js 3.27.0" |
We're getting these errors in our Ionic application with raven.js 3.26.4 |
@richardshergold if you're able to reproduce it locally, use init({
dsn: 'your_dsn',
beforeSend(event, hint) {
console.log(hint.originalException);
return event;
}
}) to investigate what's the shape of the error and update it appropriately. |
@kamilogorek thanks - I haven't been able to produce locally actually If I added that code in Production though presumably I would see that info in the console breadcrumbs? |
No, we are excluding logging from our own callbacks, otherwise, it could create an infinite loop. You can do something like: Sentry.init({
dsn: 'your_dsn',
beforeSend(event, hint) {
if (event.message.startsWith('Non-Error exception captured') && hint.originalException.error) {
Sentry.withScope((scope) => {
scope.setExtra('nonErrorException', true);
Sentry.captureException(hint.originalException.error);
});
return null;
}
return event;
}
}) This'll prevent those errors from being sent to Sentry and will catch |
@kamilogorek I have those TypeScript errors with the above code:
And
Any idea? |
@Riccardo-Andreatta yeh, my example had a bug 😅 It should be interface ExtendedError extends Error {
error: Error; // or `any`
} and then if (!hint.originalException) return event;
const customError = (hint.originalException as ExtendedError).error;
if (event.message.startsWith('Non-Error exception captured') && customError) {
Sentry.withScope((scope) => {
scope.setExtra('nonErrorException', true);
Sentry.captureException(customError);
});
return null;
} |
@kamilogorek just looking at this again - we are using Raven.js - can these events be filtered out in the same way using Raven i.e with something like the BeforeSend option you provided above? |
@richardshergold you can filter them out (there's |
@kamilogorek ok thank you. Just so I am understanding (I am in the process of deciding whether or not to move from using raven.js to the Cordova plugin and the new SDK - ours is an Ionic app) - why, with Raven, won't I have access to the original exception? (and would this be a good reason to move from raven.js?) |
There's no mechanism that passes original instance that was used to create a Sentry event. Only new v4 SDK has this feature. They are called hints https://docs.sentry.io/platforms/javascript/#hints |
@kamilogorek @HazAT I'm having this issue in react-native-sentry. How can I do the My error is |
@cihati this is exactly what you should see, as we are trying to provide any usable information that can be used to find out where is the cause :) In this case, you somewhere do
Sentry.setDataCallback((event) => {
// you can inspect and override the event here as described in the comments above
return event;
}); |
Received the following error |
@valerii-cognite then you have |
Was it fixed after 0.42.0? I get the same problem on 0.42 My code:
With this code I get |
@DataGreed not sure what's the status of react-native on this issue as I'm not working on it. However, new v1 uses |
For Angular I having the same problem with this code. I find out that returning a new empty error instance produced this error: @Injectable()
export class SentryErrorHandler implements ErrorHandler {
constructor() { }
handleError(error: any) {
if (environment.production) {
Sentry.captureException(error.originalError || error);
}
return new ErrorHandler();
}
} So I fixed with this solution: @Injectable()
export class SentryErrorHandler implements ErrorHandler {
constructor() { }
handleError(error: any) {
if (environment.production) {
Sentry.captureException(error.originalError || error);
} else {
console.error(error);
}
}
} |
i found this answer helpful from a related issue. |
@romelgomez where to place this solution code in angular 8 @Injectable() constructor() { } handleError(error: any) {
} } and one more question is ::: I think it is not necessary to console the error in production environment ... |
Hi @himajaM , I think, what i can remember is: e.g: https://sentry.io/for/angular/ Instead of using
|
Thanks for your response...
Is this the only way (i.e console.error(error)) to avoid logs in sentry?
and where can i inject SentryErrorHandler class in angular 8
…On Mon, Dec 21, 2020 at 9:55 PM Romel Gomez ***@***.***> wrote:
Hi @himajaM <https://github.com/himajaM> , I think, what i can remember
is:
e.g: https://sentry.io/for/angular/
Instead of using ErrorHandler class, I passed a new class
SentryErrorHandler
@Injectable()
export class SentryErrorHandler implements ErrorHandler {
constructor() { }
handleError(error: any) {
if (environment.production) {
Sentry.captureException(error.originalError || error);
} else {
console.error(error);
}
}
}
environment.production will be true in production and then the error will
be registed in Sentry, other side (develoment )will be log in the console
of developer and not in Sentry, this is for avoid send develoment errors
saved in Sentry API
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#391 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGHL5UIYQCQHXFPK7PW4IGLSV5ZJBANCNFSM4E3X2Y6Q>
.
|
OS:
Platform:
Output of
node -v && npm -v && npm ls --prod --depth=0
Config:
I am getting lots of crashes with this error -
The text was updated successfully, but these errors were encountered: