diff liboctave/CollocWt.cc @ 227:1a48a1b91489

[project @ 1993-11-15 10:10:35 by jwe]
author jwe
date Mon, 15 Nov 1993 10:11:59 +0000
parents 9a4c07481e61
children 780cbbc57b7c
line wrap: on
line diff
--- a/liboctave/CollocWt.cc
+++ b/liboctave/CollocWt.cc
@@ -28,6 +28,7 @@
 #include <iostream.h>
 #include "CollocWt.h"
 #include "f77-uscore.h"
+#include "lo-error.h"
 
 extern "C"
 {
@@ -43,8 +44,7 @@
 void
 CollocWt::error (const char* msg)
 {
-  cerr << "Fatal CollocWt error. " << msg << "\n";
-  exit(1);
+  (*current_liboctave_error_handler) ("fatal CollocWt error: %s", msg);
 }
 
 CollocWt::CollocWt (void)
@@ -183,7 +183,10 @@
 CollocWt::set_left (double val)
 {
   if (val >= rb)
-    error ("left bound greater than right bound");
+    {
+      error ("left bound greater than right bound");
+      return *this;
+    }
 
   lb = val;
   initialized = 0;
@@ -210,7 +213,10 @@
 CollocWt::set_right (double val)
 {
   if (val <= lb)
-    error ("right bound less than left bound");
+    {
+      error ("right bound less than left bound");
+      return *this;
+    }
 
   rb = val;
   initialized = 0;
@@ -240,11 +246,17 @@
 
   double wid = rb - lb;
   if (wid <= 0.0)
-    error ("width less than or equal to zero");
+    {
+      error ("width less than or equal to zero");
+      return;
+    }
 
   nt = n + inc_left + inc_right;
   if (nt < 0)
-    error ("total number of collocation points less than zero");
+    {
+      error ("total number of collocation points less than zero");
+      return;
+    }
   else if (nt == 0)
     return;