Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
e5b3e4f5
Commit
e5b3e4f5
authored
Nov 12, 2015
by
Ray Schamp
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #233 from rschamp/bugfix/sentry-dsn
Split CLIENT_ and NODE_ SENTRY_DSN vars
parents
7ed45cb5
85360064
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
server/config.js
server/config.js
+1
-1
server/index.js
server/index.js
+4
-4
No files found.
server/config.js
View file @
e5b3e4f5
...
...
@@ -19,7 +19,7 @@ module.exports = {
ga_tracker
:
process
.
env
.
GA_TRACKER
||
''
,
// Error handling
sentry_dsn
:
process
.
env
.
SENTRY_DSN
||
''
,
sentry_dsn
:
process
.
env
.
CLIENT_
SENTRY_DSN
||
''
,
// Use minified JS libraries
min
:
(
process
.
env
.
NODE_ENV
===
'
production
'
)
?
'
.min
'
:
''
...
...
server/index.js
View file @
e5b3e4f5
...
...
@@ -47,20 +47,20 @@ for (var routeId in routes) {
app
.
get
(
route
.
pattern
,
handler
(
route
));
}
if
(
typeof
process
.
env
.
SENTRY_DSN
===
'
string
'
)
{
if
(
typeof
process
.
env
.
NODE_
SENTRY_DSN
===
'
string
'
)
{
var
raven
=
require
(
'
raven
'
);
app
.
get
(
'
/sentrythrow
'
,
function
mainHandler
()
{
throw
new
Error
(
'
Sentry Test
'
);
});
// These handlers must be applied _AFTER_ other routes have been applied
app
.
use
(
raven
.
middleware
.
express
.
requestHandler
(
process
.
env
.
SENTRY_DSN
));
app
.
use
(
raven
.
middleware
.
express
.
errorHandler
(
process
.
env
.
SENTRY_DSN
));
app
.
use
(
raven
.
middleware
.
express
.
requestHandler
(
process
.
env
.
NODE_
SENTRY_DSN
));
app
.
use
(
raven
.
middleware
.
express
.
errorHandler
(
process
.
env
.
NODE_
SENTRY_DSN
));
app
.
use
(
function
errorHandler
(
err
,
req
,
res
,
next
)
{
res
.
append
(
'
X-Sentry-ID:
'
+
res
.
sentry
);
res
.
status
(
500
);
next
(
err
);
});
raven
.
patchGlobal
(
process
.
env
.
SENTRY_DSN
,
function
()
{
raven
.
patchGlobal
(
process
.
env
.
NODE_
SENTRY_DSN
,
function
()
{
process
.
exit
(
-
1
);
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment