-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
97 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import 'package:animu/utils/global.dart'; | ||
import 'package:sentry/sentry.dart'; | ||
|
||
class ErrorService { | ||
static final _sentry = SentryClient(dsn: Global.errorsDSN); | ||
|
||
static bool get isInDebugMode { | ||
// Assume you're in production mode. | ||
bool inDebugMode = false; | ||
|
||
// Assert expressions are only evaluated during development. They are ignored | ||
// in production. Therefore, this code only sets `inDebugMode` to true | ||
// in a development environment. | ||
assert(inDebugMode = true); | ||
|
||
return inDebugMode; | ||
} | ||
|
||
static void report(Object e, StackTrace s) { | ||
try { | ||
if (isInDebugMode) { | ||
print(e); | ||
} else { | ||
_sentry.captureException( | ||
exception: e, | ||
stackTrace: s, | ||
); | ||
} | ||
} catch (sentryError) { | ||
print('Sending report to sentry.io failed: $sentryError'); | ||
print('Original error: $e'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class Global { | ||
static final appUrl = 'https://animu.juanm04.com'; | ||
static final requestsEndpoint = 'https://animeflv.juanm04.com/graphql'; | ||
static final errorsDSN = | ||
'https://c67cfc459f304dac8f043c3bad519336@sentry.io/1898336'; | ||
static final repo = 'JuanM04/animu'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters