forked from darsen/java-koans
-
Notifications
You must be signed in to change notification settings - Fork 0
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
mat
authored and
mat
committed
Oct 15, 2012
1 parent
5bc1473
commit ec9fa00
Showing
5 changed files
with
36 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.sandwich.util; | ||
|
||
import java.io.PrintWriter; | ||
import java.io.StringWriter; | ||
|
||
public class ExceptionUtils { | ||
|
||
public static String convertToPopulatedStackTraceString(Throwable t) { | ||
StringWriter stringWriter = new StringWriter(); | ||
if(t == null){ | ||
return ""; | ||
} | ||
t.printStackTrace(new PrintWriter(stringWriter)); | ||
return stringWriter.toString(); | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
lib/util/src/com/sandwich/util/io/ui/DefaultErrorPresenter.java
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,10 @@ | ||
package com.sandwich.util.io.ui; | ||
|
||
public class DefaultErrorPresenter implements ErrorPresenter { | ||
|
||
@Override | ||
public void displayError(String error) { | ||
System.err.println(error); | ||
} | ||
|
||
} |
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 @@ | ||
package com.sandwich.util.io.ui; | ||
|
||
public interface ErrorPresenter { | ||
|
||
void displayError(String error); | ||
|
||
} |