Skip to content
Permalink
Browse files

Added args to method that throws exception in order to provide parame…

…ters to exception stack trace in a demo
  • Loading branch information...
stevensouza committed Jul 5, 2019
1 parent be789d6 commit c9ab3e914b235dc36804b37ab9bc168ecccfc2df
@@ -15,7 +15,7 @@ public String getLastName() {
return "Souza";
}

public void iMessedUp() {
public void iMessedUp(String firstName, String lastName) {
throw new RuntimeException("I really did it this time!");
}

@@ -27,7 +27,7 @@ public void run(String[] args) throws Exception {
System.out.println(" ** "+getFirstName());
System.out.println(" ** "+getLastName());
try {
iMessedUp();
iMessedUp("Steve", "Souza");
} catch (RuntimeException exception) {
// hidden exception
}
@@ -21,12 +21,12 @@
@Override
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
throws IOException {
HelloWorld helloWorld = new HelloWorld();
PrintWriter out = response.getWriter();
out.println("Hello World & "+helloWorld.getFirstName()+" "+helloWorld.getLastName());
try {
helloWorld.iMessedUp();
helloWorld.iMessedUp("Steve","Souza");
} catch (Exception exception) {
// hidden exception
}

0 comments on commit c9ab3e9

Please sign in to comment.
You can’t perform that action at this time.