diff --git a/common/misc.hh b/common/misc.hh
index 85c46b55f84e2fab3ad305a1024c99aeb8619af1..04e2c9ff1d7c7bc583316d2a08943d104ea986f4 100644
--- a/common/misc.hh
+++ b/common/misc.hh
@@ -116,8 +116,7 @@ namespace Dune {
     case 10 : { sprintf(cp, "%010d", ntime); break; }
     default :
     {
-      std::cerr << "Couldn't gernerate filename with precision = "<<precision << ", file = " << __FILE__ << ", line = " << __LINE__ << "\n";
-      abort();
+      DUNE_THROW(Exception, "Couldn't gernerate filename with precision = "<<precision);
     }
     }
     name << cp;