From 1a8a236cdd981d68d6d5d7e07aeb39531e202af3 Mon Sep 17 00:00:00 2001 From: David Huynh Date: Tue, 16 Mar 2010 18:40:07 +0000 Subject: [PATCH] Added an error page for when a project create operation fails. git-svn-id: http://google-refine.googlecode.com/svn/trunk@307 7d457c2a-affb-35e4-300a-418c747d4874 --- .../commands/edit/CreateProjectCommand.java | 4 +- src/main/webapp/error.html | 42 +++++++++++++++++++ src/main/webapp/styles/error.css | 3 ++ 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/main/webapp/error.html create mode 100644 src/main/webapp/styles/error.css diff --git a/src/main/java/com/metaweb/gridworks/commands/edit/CreateProjectCommand.java b/src/main/java/com/metaweb/gridworks/commands/edit/CreateProjectCommand.java index 1332724a7..57f4a91d8 100644 --- a/src/main/java/com/metaweb/gridworks/commands/edit/CreateProjectCommand.java +++ b/src/main/java/com/metaweb/gridworks/commands/edit/CreateProjectCommand.java @@ -55,7 +55,9 @@ public class CreateProjectCommand extends Command { redirect(response, "/project.html?project=" + project.id); } catch (Exception e) { - // TODO Auto-generated catch block + redirect(response, "/error.html?redirect=index.html&msg=" + + ParsingUtilities.encode("Failed to import file: " + e.getLocalizedMessage()) + ); e.printStackTrace(); } } diff --git a/src/main/webapp/error.html b/src/main/webapp/error.html new file mode 100644 index 000000000..97cea210e --- /dev/null +++ b/src/main/webapp/error.html @@ -0,0 +1,42 @@ + + + + + + Error - Gridworks + + + + + + + + + + +
+

Oops, something went wrong!

+

+

Redirecting you back to Gridworks' home page in 20 seconds ...

+
+ + + + \ No newline at end of file diff --git a/src/main/webapp/styles/error.css b/src/main/webapp/styles/error.css new file mode 100644 index 000000000..eb1457a7b --- /dev/null +++ b/src/main/webapp/styles/error.css @@ -0,0 +1,3 @@ +#body { + padding: 5em; +} \ No newline at end of file