Skip to content

Commit 08dce86

Browse files
authored
Merge pull request GoogleCloudPlatform#394 from GoogleCloudPlatform/mailjet
Update mailjet samples to new version.
2 parents 8506f03 + 02391d8 commit 08dce86

File tree

5 files changed

+17
-5
lines changed

5 files changed

+17
-5
lines changed

appengine/mailjet/pom.xml

+4-3
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@
2525
<version>1.0.0</version>
2626
<relativePath>../..</relativePath>
2727
</parent>
28+
<properties>
29+
<mailjet.version>4.0.5</mailjet.version>
30+
</properties>
2831
<dependencies>
2932
<dependency>
3033
<groupId>com.mailjet</groupId>
3134
<artifactId>mailjet-client</artifactId>
32-
<version>4.0.4</version>
33-
<scope>system</scope>
34-
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/client-3.1.1-jar-with-dependencies.jar</systemPath>
35+
<version>${mailjet.version}</version>
3536
</dependency>
3637
<dependency>
3738
<groupId>javax.servlet</groupId>

appengine/mailjet/src/main/java/com/example/appengine/mailjet/MailjetServlet.java

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.mailjet.client.MailjetRequest;
2121
import com.mailjet.client.MailjetResponse;
2222
import com.mailjet.client.errors.MailjetException;
23+
import com.mailjet.client.errors.MailjetSocketTimeoutException;
2324
import com.mailjet.client.resource.Email;
2425
// [END mailjet_imports]
2526

@@ -64,6 +65,8 @@ public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOEx
6465
resp.getWriter().print(response.getData());
6566
} catch (MailjetException e) {
6667
throw new ServletException("Mailjet Exception", e);
68+
} catch (MailjetSocketTimeoutException e) {
69+
throw new ServletException("Mailjet socket timed out", e);
6770
}
6871
}
6972
}

compute/mailjet/pom.xml

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
<relativePath>../..</relativePath>
2727
</parent>
2828

29+
<properties>
30+
<mailjet.version>4.0.5</mailjet.version>
31+
</properties>
32+
2933
<dependencies>
3034
<dependency>
3135
<groupId>junit</groupId>
@@ -50,7 +54,7 @@
5054
<dependency>
5155
<groupId>com.mailjet</groupId>
5256
<artifactId>mailjet-client</artifactId>
53-
<version>4.0.5</version>
57+
<version>${mailjet.version}</version>
5458
</dependency>
5559
<!-- [END dependencies] -->
5660
</dependencies>

flexible/mailjet/pom.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<maven-war-plugin-version>3.0.0</maven-war-plugin-version>
3434
<gcloud-maven-plugin-version>2.0.9.121.v20160815</gcloud-maven-plugin-version>
3535
<jetty-maven-plugin-version>9.3.7.v20160115</jetty-maven-plugin-version>
36+
<mailjet-version>4.0.5</mailjet-version>
3637
</properties>
3738

3839
<dependencies>
@@ -47,7 +48,7 @@
4748
<dependency>
4849
<groupId>com.mailjet</groupId>
4950
<artifactId>mailjet-client</artifactId>
50-
<version>4.0.1</version>
51+
<version>${mailjet-version}</version>
5152
</dependency>
5253
<!-- [END dependencies] -->
5354
</dependencies>

flexible/mailjet/src/main/java/com/example/managedvms/mailjet/MailjetServlet.java

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.mailjet.client.MailjetRequest;
2222
import com.mailjet.client.MailjetResponse;
2323
import com.mailjet.client.errors.MailjetException;
24+
import com.mailjet.client.errors.MailjetSocketTimeoutException;
2425
import com.mailjet.client.resource.Email;
2526
// [END mailjet_imports]
2627

@@ -67,6 +68,8 @@ public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOEx
6768
resp.getWriter().print(response.getData());
6869
} catch (MailjetException e) {
6970
throw new ServletException("Mailjet Exception", e);
71+
} catch (MailjetSocketTimeoutException e) {
72+
throw new ServletException("Mailjet socket timed out", e);
7073
}
7174
}
7275
}

0 commit comments

Comments
 (0)