diff --git a/src/storm/exceptions/InternalException.h b/src/storm/exceptions/InternalException.h new file mode 100644 index 000000000..e28f8f4fd --- /dev/null +++ b/src/storm/exceptions/InternalException.h @@ -0,0 +1,12 @@ +#pragma once + +#include "storm/exceptions/BaseException.h" +#include "storm/exceptions/ExceptionMacros.h" + +namespace storm { + namespace exceptions { + + STORM_NEW_EXCEPTION(InternalException) + + } +} diff --git a/src/storm/storage/BitVectorHashMap.cpp b/src/storm/storage/BitVectorHashMap.cpp index e6b769a67..641fc07aa 100644 --- a/src/storm/storage/BitVectorHashMap.cpp +++ b/src/storm/storage/BitVectorHashMap.cpp @@ -5,6 +5,7 @@ #include #include "storm/utility/macros.h" +#include "storm/exceptions/InternalException.h" namespace storm { namespace storage { @@ -72,7 +73,7 @@ namespace storm { template void BitVectorHashMap::increaseSize() { ++currentSizeIterator; - STORM_LOG_ASSERT(currentSizeIterator != sizes.end(), "Hash map became to big."); + STORM_LOG_THROW(currentSizeIterator != sizes.end(), storm::exceptions::InternalException, "Hash map became to big."); // Create new containers and swap them with the old ones. numberOfElements = 0; @@ -97,10 +98,10 @@ namespace storm { uint_fast64_t failCount = 0; while (fail) { ++failCount; - STORM_LOG_ASSERT(failCount < 2, "Increasing size failed too often."); + STORM_LOG_THROW(failCount < 2, storm::exceptions::InternalException, "Increasing size failed too often."); ++currentSizeIterator; - STORM_LOG_ASSERT(currentSizeIterator != sizes.end(), "Hash map became to big."); + STORM_LOG_THROW(currentSizeIterator != sizes.end(), storm::exceptions::InternalException, "Hash map became to big."); numberOfElements = 0; buckets = storm::storage::BitVector(bucketSize * *currentSizeIterator);