Index: customerror.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/customerror/customerror.module,v
retrieving revision 1.13.2.9
diff -u -r1.13.2.9 customerror.module
--- customerror.module	13 Sep 2008 02:51:55 -0000	1.13.2.9
+++ customerror.module	5 Oct 2008 22:59:00 -0000
@@ -215,3 +215,16 @@
   }
 }
 
+/**
+ * Implementation of hook_form_alter. We need this to be able to search from
+ * the error pages, otherwise the form POST's to the error page, bringing no
+ * results page.
+ */
+function customerror_form_alter($form_id, &$form) {
+  switch ($form_id) {
+    case 'search_theme_form':
+      if (arg(0) == 'customerror')
+        $form['#action'] = url('search/node');
+      break;
+  }
+}
