whoops - needed to catch some exceptions
This commit is contained in:
parent
116a67376d
commit
d5243d7af2
|
@ -91,7 +91,18 @@ public class EmoticonTagHandler implements Rewriter
|
||||||
public MarkupData rewrite(String data, RewriterServices svc)
|
public MarkupData rewrite(String data, RewriterServices svc)
|
||||||
{
|
{
|
||||||
logger.debug("EmoticonTagHandler looking at: " + data);
|
logger.debug("EmoticonTagHandler looking at: " + data);
|
||||||
RE r = new RE("ei:\\s*(\\w+)(?:\\s*/)?\\s*");
|
RE r = null;
|
||||||
|
try
|
||||||
|
{ // compile regular expression
|
||||||
|
r = new RE("ei:\\s*(\\w+)(?:\\s*/)?\\s*");
|
||||||
|
|
||||||
|
} // end try
|
||||||
|
catch (RESyntaxException e)
|
||||||
|
{ // something wicked this way comes
|
||||||
|
logger.fatal("WTF?!?!?!?",e);
|
||||||
|
|
||||||
|
} // end catch
|
||||||
|
|
||||||
if (!(r.match(data)))
|
if (!(r.match(data)))
|
||||||
return null;
|
return null;
|
||||||
String icon_name = r.getParen(1);
|
String icon_name = r.getParen(1);
|
||||||
|
|
|
@ -149,7 +149,18 @@ public class EmoticonManager
|
||||||
|
|
||||||
public String rewriteText(RequestOutput out, String txt)
|
public String rewriteText(RequestOutput out, String txt)
|
||||||
{
|
{
|
||||||
RE r = new RE("<ei:\\s*(\\w+)(?:\\s*/)?\\s*>");
|
RE r = null;
|
||||||
|
try
|
||||||
|
{ // create the regexp
|
||||||
|
r = new RE("<ei:\\s*(\\w+)(?:\\s*/)?\\s*>");
|
||||||
|
|
||||||
|
} // end try
|
||||||
|
catch (RESyntaxException e)
|
||||||
|
{ // something wicked this way comes
|
||||||
|
logger.fatal("WTF?!?!?!?",e);
|
||||||
|
|
||||||
|
} // end catch
|
||||||
|
|
||||||
if (!(r.match(txt)))
|
if (!(r.match(txt)))
|
||||||
{ // null it out
|
{ // null it out
|
||||||
logger.debug("EmoticonManager.rewriteText matched nothing at all");
|
logger.debug("EmoticonManager.rewriteText matched nothing at all");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user