Comments (12)
I'll take a look at this today.
from sentry-javascript.
@jmagnusson I just tested this and all appears well. Are you using the latest version of raven? And if so, what browser?
from sentry-javascript.
Hopefully it's on my end. I have Raven 1.0.5
and testing has been done on OS X with Chrome. I just tested it in the latest versions of Firefox and Safari, but it seems that sentry doesn't actually record the event for those two browsers, even though the GET request is sent just fine with a 200 response code. The Chrome request is handled by sentry, but without the tags sent along as previously mentioned.
Other info:
Sentry 5.4.1
*
is used in CORS-setting in Sentry
This is what the Raven-related code looks like:
require(['startup'], function() {
require([
'cs!app/state',
'app/config',
'raven'
], function(
appstate,
appConf,
Raven
) {
var host = window.location.host,
ravenOpts = {tags: {host: host}};
// Initialize the error handler
Raven.config(appConf.sentryDSN).install();
try {
appstate();
}
catch (exc) {
// TODO: Why doesn't tags appear in Sentry?
// TODO #2: Maybe alert user that an error has occurred
Raven.captureException(exc, ravenOpts);
throw exc;
}
});
});
from sentry-javascript.
I've also tried the latest master (5f92fc02f6
) combined with the TraceKit version this repo links to (2964a1e
at the time of writing). No success.
I should also add that captureMessage
works fine in all three browsers. captureException
only works in Chrome as I previously mentioned.
from sentry-javascript.
Removing install()
from the code above so that window.onerror handler isn't added didn't make a difference either.
Passing my ravenOpts directly to Raven.config
didn't send along tags either (not even for captureMessage
).
from sentry-javascript.
Are you trying to run from git directly, by any chance? Just including the src/raven.js is probably not the best idea.
Either way, could you intercept the makeRequest() function and see the data that's being sent?
from sentry-javascript.
I first tried the tagged 1.0.5 version found here, then also tried the src/raven.js
and vendor/TraceKit/tracekit.js
using the require.js
shim config like this:
requirejs.config({
paths: {
jquery: 'ext/jquery',
tracekit: 'ext/tracekit', // Error reporting
raven: 'ext/raven', // Error reporting
},
shim: {
jquery: {exports: 'jQuery'},
tracekit: {exports: 'TraceKit', deps: ['jquery']},
raven: {exports: 'Raven', deps: ['tracekit']},
}
})
Both "flavors" had the same problems which I mentioned previously.
Here's the data being sent with makeRequest:
URL (same for all tested browsers):
http://our.sentry.dev/api/5/store/?sentry_version=2.0&sentry_client=raven-js/1.0.5&sentry_key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&sentry_data=<json>
Gist with sentry_data for the different browsers can be found here
Our main.js
where raven-js handler is added:
require(['startup'], function() {
require([
'cs!our/app/state',
'our/app/config',
'raven',
'underscore.string'
], function(
appstate,
appConf,
Raven,
_s
) {
var host = window.location.host,
ravenOpts = {tags: {host: host}};
// Initialize the error handler
// Raven.install adds a global error handler to window.onerror
Raven.config(appConf.sentryDSN, ravenOpts).install();
throw Error('Testing captureException with raven-js');
appstate();
});
});
from sentry-javascript.
First of all, thanks a ton for the information! :)
Now, just to clarify, you've posted two different ways of tacking on the extra data. First, you showed it being added directly to captureException(), then second, you showed it added to the config() call. I'm guessing that they're both working incorrectly?
from sentry-javascript.
And thanks for making this awesome script! :-)
Actually I noticed that the catch-statement was never reached. It seems that the global window.onerror handler added by Raven.install re-raised the exception and script execution stopped after that. Maybe I could create a simple test so that it can be replicated.
from sentry-javascript.
Well, technically, an error that is cause, is supposed to be reraised. That is by design. Raven's job isn't supposed to intercept all of your errors and make them go away. Raven is just a middleware, if you will, that logs it. Typically, on an uncaught exception, you want the error to bubble up to the user and break because unexpected things can happen if your code keeps executing. So as a developer, it's your job to still catch your own errors and handle things appropriately.
from sentry-javascript.
Hello
I use 1.0.8.
Could you help me how can I send tags with function ?
function traceKitWindowOnError(message, url, lineNo)
var options = {
logger: 'my-logger',
tags: {
bank_id: "999999"}};
Raven.config(sentryUrl, options).install();
It doesn't send tags
from sentry-javascript.
This should all be working just fine. Open a new ticket if it's broken in 1.1.
from sentry-javascript.
Related Issues (20)
- Supportability of the Lit framework HOT 1
- Node.js 20.12.x binaries are missing HOT 5
- Support Node 22 HOT 1
- Ember Canary ember-release Test Failed
- nextjs-app-dir (canary) Test Failed
- nextjs-app-dir (latest) Test Failed
- @sentry/nextjs bundled twice HOT 7
- `inboundFiltersIntegration` logs error for native events HOT 1
- nextjs-14 (canary) Test Failed
- nextjs-14 (latest) Test Failed
- rewrite of fetch is not exact HOT 3
- Export @sentry/vue errorHandler HOT 4
- [v8] Remove `Hub` class
- Ember Canary ember-release Test Failed
- nextjs-14 (latest) Test Failed
- nextjs-app-dir (canary) Test Failed
- nextjs-14 (canary) Test Failed
- nextjs-app-dir (latest) Test Failed
- Node SDK: Some transactions are not showing db queries HOT 6
- Baggage header size from sentry causes 431 error for us HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentry-javascript.