about summary refs log tree commit diff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorPjotr Prins2017-08-14 07:43:07 +0000
committerPjotr Prins2017-08-14 08:23:14 +0000
commitff1252fe3db1ba639fe148f45b0408a4f182da0d (patch)
treee11ee6858159b53b2570273f9ba3d1ac882232f7 /src/main.cpp
parent3763f477e17a74942e1bf545aa9493d39bf9448e (diff)
downloadpangemma-ff1252fe3db1ba639fe148f45b0408a4f182da0d.tar.gz
Tests and fixes https://github.com/genetics-statistics/GEMMA/issues/26
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;