mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-11-14 01:51:22 +01:00
Capture client javascript errors with sentry too
This commit is contained in:
parent
c2bf983983
commit
5f8ecf03ed
@ -30,4 +30,5 @@ config = {
|
||||
|
||||
# Sentry.io is used to track and upload errors
|
||||
"sentry-dsn": "Copy the dns string when creating a project on sentry",
|
||||
"sentry-js-dsn": "Same as above, but you can create a seperate sentry project to track the client side js errors",
|
||||
}
|
||||
|
@ -88,6 +88,7 @@ def before_first_request():
|
||||
def context_processor():
|
||||
return {
|
||||
"devs": get_administrators_list(),
|
||||
"sentry_js_dsn": config.get("sentry-js-dsn", None),
|
||||
"constants": constants,
|
||||
"af_mode_enabled": datetime.datetime.now().date() == datetime.date(datetime.datetime.now().year, 4, 1),
|
||||
"dbl_voted": session.get("unauthenticated", True) == False and bool(redis_store.get("DiscordBotsOrgVoted/" + str(session.get("user_id", -1))))
|
||||
|
@ -336,6 +336,8 @@
|
||||
<script src="{{ url_for('static', filename='js/vendor/emoji.min.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/vendor/wdt-emoji-bundle.min.js') }}"></script>
|
||||
|
||||
{% include 'sentry_js_init.html.j2' %}
|
||||
|
||||
{% raw %}
|
||||
<script id="mustache_channellistings" type="text/template">
|
||||
<li><a class="waves-effect truncate" id="channel-{{channelid}}"><span class="channel-hash">#</span> {{channelname}}</a></li>
|
||||
|
4
webapp/titanembeds/templates/sentry_js_init.html.j2
Normal file
4
webapp/titanembeds/templates/sentry_js_init.html.j2
Normal file
@ -0,0 +1,4 @@
|
||||
<script src="https://cdn.ravenjs.com/3.26.2/raven.min.js" crossorigin="anonymous"></script>
|
||||
<script>
|
||||
Raven.config({{ sentry_js_dsn|tojson|safe }}).install();
|
||||
</script>
|
@ -93,6 +93,8 @@
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js" integrity="sha256-uWtSXRErwH9kdJTIr1swfHFJn/d/WQ6s72gELOHXQGM=" crossorigin="anonymous"></script>
|
||||
|
||||
{% include 'sentry_js_init.html.j2' %}
|
||||
|
||||
{% if not dbl_voted or (dbl_voted and request.path == "/") %}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
Loading…
Reference in New Issue
Block a user