Skip to content

Java: Replaced getStackTrace() calls with printStackTrace() calls #7497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static void main(String[] args) {
}

} catch (AmazonDynamoDBException e) {
e.getStackTrace();
e.printStackTrace();
}

// snippet-end:[dynamodb.java.dynamoDB_scan.main]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static void main(String[] args) {

System.out.print("Done");
} catch (AmazonDynamoDBException e) {
e.getStackTrace();
e.printStackTrace();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static void main(String[] args) {
}
System.out.print("Done");
} catch (Exception e) {
e.getStackTrace();
e.printStackTrace();
}
// snippet-end:[ec2.java1.describe_account.main]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static void main(String[] args) {
System.out.print("Done");

} catch (SdkClientException e) {
e.getStackTrace();
e.printStackTrace();
}
// snippet-end:[ec2.java1.running_instances.main]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static void main(String[] args) {
System.out.println(item.getSource());

} catch (AmazonServiceException e) {
e.getStackTrace();
e.printStackTrace();
}
// snippet-end:[ssm.Java1.get_ops.main]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static void main(String[] args) {
}

} catch (AmazonServiceException e) {
e.getStackTrace();
e.printStackTrace();
}
// snippet-end:[ssm.Java1.get_params.main]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public static void getPresignedUrl(S3Presigner presigner, String bucketName, Str
}

} catch (S3Exception | IOException e) {
e.getStackTrace();
e.printStackTrace();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static void main(String[] args) throws IOException {
System.out.println("Done");

} catch (IOException | MessagingException e) {
e.getStackTrace();
e.printStackTrace();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static void main(String[] args) throws IOException {
System.out.println("Done");

} catch (IOException | MessagingException e) {
e.getStackTrace();
e.printStackTrace();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static void main(String[] args) {
System.out.println("Done");

} catch (MessagingException e) {
e.getStackTrace();
e.printStackTrace();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static void describeParams(SsmClient ssmClient) {
}

} catch (SsmException e) {
e.getStackTrace();
e.printStackTrace();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion javav2/usecases/Creating_rds_item_tracker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public class ConnectionHelper {
return DriverManager.getConnection(url2, user, password);

} catch (SQLException | ClassNotFoundException e) {
e.getStackTrace();
e.printStackTrace();
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static Connection getConnection(String host, String user, String password
return DriverManager.getConnection(url2, user, password);

} catch (SQLException | ClassNotFoundException e) {
e.getStackTrace();
e.printStackTrace();
}
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion javav2/usecases/create_workflow_redshift/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ public class HandlerSES implements RequestHandler<String, String> {

} catch (javax.mail.MessagingException e)
{
e.getStackTrace();
e.printStackTrace();
}

return "Ok" ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public String handleRequest(String event, Context context) {
msg.sendMessage(client, sender, recipient, subject, bodyHTML);

} catch (javax.mail.MessagingException e) {
e.getStackTrace();
e.printStackTrace();
}

return "Ok";
Expand Down
4 changes: 2 additions & 2 deletions javav2/usecases/creating_message_application/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ public class SendReceiveMessages {
return allMessages;

} catch (SqsException e) {
e.getStackTrace();
e.printStackTrace();
}
return null;
}
Expand Down Expand Up @@ -372,7 +372,7 @@ public class SendReceiveMessages {
sqsClient.sendMessage(sendMsgRequest);

} catch (SqsException e) {
e.getStackTrace();
e.printStackTrace();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public List<MessageData> getMessages() {
return allMessages;

} catch (SqsException e) {
e.getStackTrace();
e.printStackTrace();
}
return null;
}
Expand Down Expand Up @@ -142,7 +142,7 @@ public void processMessage(MessageData msg) {
sqsClient.sendMessage(sendMsgRequest);

} catch (SqsException e) {
e.getStackTrace();
e.printStackTrace();
}
}
}
2 changes: 1 addition & 1 deletion javav2/usecases/creating_photo_analyzer_app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ public class SendMessages {
try {
send(fileContent,emailAddress);
} catch (MessagingException e) {
e.getStackTrace();
e.printStackTrace();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void sendReport(InputStream is, String emailAddress) throws IOException {
try {
send(fileContent, emailAddress);
} catch (MessagingException e) {
e.getStackTrace();
e.printStackTrace();
}
}

Expand Down
2 changes: 1 addition & 1 deletion javav2/usecases/creating_photo_analyzer_async/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ The following Java code represents the **SendMessage** class. This class uses th
try {
send(fileContent,emailAddress);
} catch (MessagingException e) {
e.getStackTrace();
e.printStackTrace();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void sendReport(InputStream is, String emailAddress) throws IOException {
try {
send(fileContent, emailAddress);
} catch (MessagingException e) {
e.getStackTrace();
e.printStackTrace();
}
}

Expand Down
4 changes: 2 additions & 2 deletions javav2/usecases/creating_workflows_stepfunctions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ The **Handler3** class is the third step in the workflow and creates a **SendMes

} catch (IOException e)
{
e.getStackTrace();
e.printStackTrace();
}

return "";
Expand Down Expand Up @@ -491,7 +491,7 @@ The following Java class represents the **SendMessage** class. This class uses t
send(client, sender,email, subject,bodyText,bodyHTML);

} catch (IOException | MessagingException e) {
e.getStackTrace();
e.printStackTrace();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public String handleRequest(String event, Context context) {
msg.sendMessage(email);

} catch (IOException e) {
e.getStackTrace();
e.printStackTrace();
}

return "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void sendMessage(String email) throws IOException {
send(client, sender, email, subject, bodyText, bodyHTML);

} catch (IOException | MessagingException e) {
e.getStackTrace();
e.printStackTrace();
}
}

Expand Down
2 changes: 1 addition & 1 deletion javav2/usecases/video_analyzer_application/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ The following Java code represents the **SendMessage** class. This class uses th
try {
send(fileContent,emailAddress);
} catch (MessagingException e) {
e.getStackTrace();
e.printStackTrace();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void sendReport(InputStream is, String emailAddress) throws IOException {
try {
send(fileContent, emailAddress);
} catch (MessagingException e) {
e.getStackTrace();
e.printStackTrace();
}
}

Expand Down