Skip to content

Commit

Permalink
#37 sentry added
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jul 20, 2017
1 parent 72e524b commit 8591a0a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@
<timestamp>${maven.build.timestamp}</timestamp>
</properties>
<dependencies>
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-core</artifactId>
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/io/jare/Entrance.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import io.jare.dynamo.DyBase;
import io.jare.model.Base;
import io.jare.tk.TkApp;
import io.sentry.Sentry;
import java.io.IOException;
import org.takes.http.Exit;
import org.takes.http.FtCli;
Expand All @@ -54,6 +55,7 @@ private Entrance() {
* @throws IOException If fails
*/
public static void main(final String... args) throws IOException {
Sentry.init(Manifests.read("Jare-SentryDsn"));
final Base base = new CdBase(new DyBase());
new Logs(
base,
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/io/jare/tk/TkAppFallback.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
package io.jare.tk;

import com.jcabi.manifests.Manifests;
import io.sentry.Sentry;
import java.io.IOException;
import java.net.HttpURLConnection;
import org.apache.commons.lang3.exception.ExceptionUtils;
Expand Down Expand Up @@ -85,6 +86,10 @@ private static Take make(final Take take) {
HttpURLConnection.HTTP_BAD_REQUEST
)
),
req -> {
Sentry.capture(req.throwable());
return new Opt.Empty<>();
},
req -> new Opt.Single<>(TkAppFallback.fatal(req))
)
);
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ Jare-CloudFrontSecret: ${cloudfront.secret}
Jare-GithubId: ${github.id}
Jare-GithubSecret: ${github.secret}
Jare-SecurityKey: ${security.key}
Jare-SentryDsn: ${sentry.dsn}
1 change: 1 addition & 0 deletions src/test/resources/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ Jare-CloudFrontSecret: -
Jare-GithubId: ${failsafe.github.id}
Jare-GithubSecret: ${failsafe.github.secret}
Jare-SecurityKey: ${failsafe.security.key}
Jare-SentryDsn: test

0 comments on commit 8591a0a

Please sign in to comment.