about summary refs log tree commit diff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 833136c..e37b154 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -25,10 +25,20 @@
 
 using namespace std;
 
+void gemma_gsl_error_handler (const char * reason,
+                              const char * file,
+                              int line, int gsl_errno) {
+  cerr << "GSL ERROR: " << reason << " in " << file
+       << " at line " << line << " errno " << gsl_errno <<endl;
+  exit(22);
+}
+
 int main(int argc, char *argv[]) {
   GEMMA cGemma;
   PARAM cPar;
 
+  gsl_set_error_handler (&gemma_gsl_error_handler);
+
   if (argc <= 1) {
     cGemma.PrintHeader();
     return EXIT_SUCCESS;