Skip to content

Commit

Permalink
Handle exception when user defined regular expression is invalid.
Browse files Browse the repository at this point in the history
  • Loading branch information
acaudwell committed Oct 28, 2014
1 parent 4606600 commit 81a599c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.0.7:
* Handle exception when user defined regular expression is invalid.

1.0.6:
* Display invalid requests as having the path '???'.
* Updated the boost autoconf macro.
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

AC_PREREQ(2.61)

AC_INIT(Logstalgia, 1.0.6, [acaudwell@gmail.com])
AC_INIT(Logstalgia, 1.0.7, [acaudwell@gmail.com])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([src/main.cpp])

Expand Down
10 changes: 9 additions & 1 deletion src/logstalgia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,15 @@ void Logstalgia::addGroup(const std::string& group_by, const std::string& groupt
percent = remaining_percent;
}

Summarizer* summarizer = new Summarizer(fontSmall, percent, settings.update_rate, groupregex, grouptitle);

Summarizer* summarizer = 0;

try {
summarizer = new Summarizer(fontSmall, percent, settings.update_rate, groupregex, grouptitle);
}
catch(RegexCompilationException& e) {
throw SDLAppException("invalid regular expression for group '%s'", grouptitle.c_str());
}

if(glm::dot(colour, colour) > 0.01f) {
summarizer->setColour(colour);
Expand Down
2 changes: 1 addition & 1 deletion src/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#ifndef LOGSTALGIA_SETTINGS_H
#define LOGSTALGIA_SETTINGS_H

#define LOGSTALGIA_VERSION "1.0.6"
#define LOGSTALGIA_VERSION "1.0.7"

#include "core/settings.h"

Expand Down

0 comments on commit 81a599c

Please sign in to comment.